From 9064bb31076b52e249e1096e320e85f321c6349e Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Wed, 24 Sep 2014 13:32:20 -0400 Subject: [PATCH] Fix a bug where we could potentially not see a hostname that we need to update instead of create when syncing inventory because its instance id had changed --- awx/main/management/commands/inventory_import.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/awx/main/management/commands/inventory_import.py b/awx/main/management/commands/inventory_import.py index d393846986..b87ace8531 100644 --- a/awx/main/management/commands/inventory_import.py +++ b/awx/main/management/commands/inventory_import.py @@ -955,14 +955,13 @@ class Command(NoArgsCommand): mem_host_names_to_update = set(self.all_group.all_hosts.keys()) for k,v in self.all_group.all_hosts.iteritems(): instance_id = '' + mem_host_name_map[k] = v if self.instance_id_var: instance_id = v.variables.get(self.instance_id_var, '') if instance_id in self.db_instance_id_map: mem_host_pk_map[self.db_instance_id_map[instance_id]] = v elif instance_id: mem_host_instance_id_map[instance_id] = v - else: - mem_host_name_map[k] = v # Update all existing hosts where we know the PK based on instance_id. all_host_pks = sorted(mem_host_pk_map.keys())