mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 01:21:21 +03:00
Make sure we disassociate inventory source from the host as part of the dereferencing operation
This commit is contained in:
parent
5df185b7af
commit
3a5544801a
@ -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():
|
||||||
|
Loading…
Reference in New Issue
Block a user