From 0f510719690efa001b2d8f0a88cdd30126efa4cf Mon Sep 17 00:00:00 2001 From: Tasos Papaioannou Date: Tue, 13 Feb 2024 13:28:52 -0500 Subject: [PATCH] Fix Ansible inventory sync to call default job lookup method only if needed --- broker/providers/ansible_tower.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/broker/providers/ansible_tower.py b/broker/providers/ansible_tower.py index 06094d96..72202368 100644 --- a/broker/providers/ansible_tower.py +++ b/broker/providers/ansible_tower.py @@ -366,7 +366,9 @@ def _compile_host_info(self, host): ) # Get broker_args from host facts if present - broker_args = getattr(host_facts, "_broker_args", self._get_broker_args_from_job(host)) + broker_args = getattr(host_facts, "_broker_args", None) or self._get_broker_args_from_job( + host + ) host_info = { "name": host.name,