Skip to content
Snippets Groups Projects
Commit 765601ce authored by Anders Harrisson's avatar Anders Harrisson
Browse files

Request all host groups from AWX if summary is not enough

parent 9032d6e0
No related branches found
No related tags found
1 merge request!13Request all host groups from AWX if summary is not enough
Pipeline #202986 failed
......@@ -96,7 +96,10 @@ def sync_host(inventory, sender, instance):
else:
logger.error(f"Invalid data for host_serializer: {host_serializer.errors}")
current_groups = host["summary_fields"]["groups"]["results"]
if len(host["summary_fields"]["groups"]["results"]) > host["summary_fields"]["groups"]["count"]:
current_groups = inventory.get_host_groups(host['id'])
else:
current_groups = host["summary_fields"]["groups"]["results"]
if hasattr(instance, 'site') and instance.site:
sync_host_group_association(inventory, host, Site, instance.site, current_groups)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment