Skip to content

Commit

Permalink
Small formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tpapaioa committed Jan 31, 2024
1 parent 72c62bb commit 61a6b32
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions broker/providers/ansible_tower.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,15 +364,15 @@ def _compile_host_info(self, host):
"_broker_provider": "AnsibleTower",
"_broker_provider_instance": self.instance,
# Get _broker_args from host facts if present
"_broker_args": getattr(host_facts, "_broker_args", {}) or self._get_broker_args_from_job(host),
"_broker_args": getattr(
host_facts, "_broker_args", self._get_broker_args_from_job(host)
),
}

return host_info

def _get_broker_args_from_job(self, host):
"""Get _broker_args from the source workflow job.
If the source workflow job could not be found, then try the last job.
"""
"""Get _broker_args from the source workflow job or last job."""
_broker_args = {}

try:
Expand Down Expand Up @@ -434,9 +434,7 @@ def construct_host(self, provider_params, host_classes, **kwargs):
else self._translate_inventory(job.summary_fields.inventory)
}

# FIXME Find better way to return ip / ansible_host from job
misc_attrs["ip"] = kwargs["ip"]
kwargs.pop("ip")
misc_attrs["ip"] = kwargs.pop("ip", None)

job_attrs = helpers.flatten_dict(job_attrs)
logger.debug(job_attrs)
Expand Down

0 comments on commit 61a6b32

Please sign in to comment.