mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03:30
AC-561 Set host has_inventory_sources flag on import.
This commit is contained in:
parent
2f3409db08
commit
a0c6c0e984
@ -570,6 +570,7 @@ class Command(NoArgsCommand):
|
||||
if self.inventory_source.group:
|
||||
self.inventory_source.group.hosts.add(host)
|
||||
host.inventory_sources.add(self.inventory_source)
|
||||
host.update_computed_fields(False, False)
|
||||
|
||||
# for each host in a mem group, add it to the parents to which it belongs
|
||||
for (k,v) in self.all_group.group_names.iteritems():
|
||||
|
||||
@ -1004,9 +1004,11 @@ class InventoryUpdatesTest(BaseTransactionTest):
|
||||
for host in inventory.hosts.all():
|
||||
source_pks = host.inventory_sources.values_list('pk', flat=True)
|
||||
self.assertTrue(inventory_source.pk in source_pks)
|
||||
self.assertTrue(host.has_inventory_sources)
|
||||
for group in inventory.groups.all():
|
||||
source_pks = group.inventory_sources.values_list('pk', flat=True)
|
||||
self.assertTrue(inventory_source.pk in source_pks)
|
||||
self.assertTrue(group.has_inventory_sources)
|
||||
|
||||
def test_update_from_ec2(self):
|
||||
source_username = getattr(settings, 'TEST_AWS_ACCESS_KEY_ID', '')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user