mirror of
https://github.com/ansible/awx.git
synced 2026-05-14 04:47:44 -02:30
Make sure we disassociate inventory source from the host as part of the dereferencing operation
This commit is contained in:
@@ -374,7 +374,10 @@ class Group(CommonModelNameNotUnique):
|
|||||||
continue
|
continue
|
||||||
for host in group.hosts.all():
|
for host in group.hosts.all():
|
||||||
host.groups.remove(group)
|
host.groups.remove(group)
|
||||||
# Remove inventory source
|
host_inv_sources = host.inventory_sources
|
||||||
|
for inv_source in group.inventory_sources:
|
||||||
|
if inv_source in host_inv_sources:
|
||||||
|
host_inv_sources.remove(inv_source)
|
||||||
if host.groups.count() < 1:
|
if host.groups.count() < 1:
|
||||||
marked_hosts.append(host)
|
marked_hosts.append(host)
|
||||||
for childgroup in group.children.all():
|
for childgroup in group.children.all():
|
||||||
|
|||||||
Reference in New Issue
Block a user