mirror of
https://github.com/ansible/awx.git
synced 2026-03-23 11:55:04 -02:30
Fix an issue where going from having 1 or more hosts to having 0 hosts
could trigger an inventory sync failure
This commit is contained in:
@@ -683,6 +683,7 @@ class Command(NoArgsCommand):
|
|||||||
del_host_pks = set(hosts_qs.values_list('pk', flat=True))
|
del_host_pks = set(hosts_qs.values_list('pk', flat=True))
|
||||||
if self.instance_id_var:
|
if self.instance_id_var:
|
||||||
all_instance_ids = self.mem_instance_id_map.keys()
|
all_instance_ids = self.mem_instance_id_map.keys()
|
||||||
|
instance_ids = []
|
||||||
for offset in xrange(0, len(all_instance_ids), self._batch_size):
|
for offset in xrange(0, len(all_instance_ids), self._batch_size):
|
||||||
instance_ids = all_instance_ids[offset:(offset + 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):
|
for host_pk in hosts_qs.filter(instance_id__in=instance_ids).values_list('pk', flat=True):
|
||||||
|
|||||||
Reference in New Issue
Block a user