Skip to content

Commit

Permalink
Fix incorrect reference to self.inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanCoding committed Dec 6, 2022
1 parent 31defa1 commit f834fb4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions awx/main/tasks/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def build_env(self, instance, private_data_dir, private_data_files=None):

return env

def _inventory_file(self, inventory, private_data_dir, file_name, script_params):
def _write_inventory_file(self, inventory, private_data_dir, file_name, script_params):
script_data = inventory.get_script_data(**script_params)
for hostname, hv in script_data.get('_meta', {}).get('hostvars', {}).items():
# maintain a list of host_name --> host_id
Expand All @@ -333,9 +333,9 @@ def build_inventory(self, instance, private_data_dir):
if instance.inventory.kind == 'multiple':
ret = []
for source_inventory in instance.inventory.source_inventories.all():
ret.append(self._inventory_file(source_inventory, private_data_dir, f'hosts_{source_inventory.id}', script_params))
ret.append(self._write_inventory_file(source_inventory, private_data_dir, f'hosts_{source_inventory.id}', script_params))
return ret
return self._inventory_file(self.inventory, private_data_dir, 'hosts', script_params)
return self._write_inventory_file(instance.inventory, private_data_dir, 'hosts', script_params)

def build_args(self, instance, private_data_dir, passwords):
raise NotImplementedError
Expand Down

0 comments on commit f834fb4

Please sign in to comment.