Attempting to expand Openstack Credentials used in Inventory Sources - help please

From this ticket https://github.com/ansible/awx/issues/268

I am trying to tweak the following class and def to enable me to add/overwrite the cloud.yml vars with ones provided by source variables in inventory sources.

https://github.com/ansible/awx/blob/devel/awx/main/tasks.py#L1612

class RunInventoryUpdate(BaseTask):

name = ‘awx.main.tasks.run_inventory_update’
model = InventoryUpdate

def build_private_data(self, inventory_update, **kwargs):
“”"
Return private data needed for inventory update.

Could i get some pointers on how i can implement some logging, so i can dump incoming and outgoing vars.

I have tried using such things as logger.info(‘nickx info4’); and logger.debug(‘nickx info4’); but these are not appearing in the logs (in docker / syslog) though other functions are logging.

Thanks in advance

Nick

Hi there, you didn’t say if you were running this through the development environment?

You can use the logger.X() routines and logging will happen through the docker console, if you are using the development environment then this will be emitted as part of the celery output (the development environment all operates under one container and the services are all multiplexed together with color coded output.

It’s important to realize that in the development environment the celery process will not autoreload on most code changes which is why when I’m working on celery tasks I’ll more often than not use this entry point:

https://github.com/ansible/awx/blob/devel/CONTRIBUTING.md#start-from-the-container-shell

Then locate the tmux pane holding celery and kill it… open a new pane and start the celery process manually which will allow you to kill it and restart it easily after you do make changes.