From f4d960b127a3db6335fcfd8a000272f12b9ab187 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Fri, 27 Mar 2015 13:25:16 -0400 Subject: [PATCH] Fix an issue where going from having 1 or more hosts to having 0 hosts could trigger an inventory sync failure --- awx/main/management/commands/inventory_import.py | 1 + 1 file changed, 1 insertion(+) diff --git a/awx/main/management/commands/inventory_import.py b/awx/main/management/commands/inventory_import.py index 4263c72ccb..51ef9fdf36 100644 --- a/awx/main/management/commands/inventory_import.py +++ b/awx/main/management/commands/inventory_import.py @@ -683,6 +683,7 @@ class Command(NoArgsCommand): del_host_pks = set(hosts_qs.values_list('pk', flat=True)) if self.instance_id_var: all_instance_ids = self.mem_instance_id_map.keys() + instance_ids = [] for offset in xrange(0, len(all_instance_ids), self._batch_size): instance_ids = all_instance_ids[offset:(offset + self._batch_size)] for host_pk in hosts_qs.filter(instance_id__in=instance_ids).values_list('pk', flat=True):