1
0
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:
Matthew Jones 2014-05-09 10:16:44 -04:00
parent 5df185b7af
commit 3a5544801a

View File

@ -374,7 +374,10 @@ class Group(CommonModelNameNotUnique):
continue
for host in group.hosts.all():
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:
marked_hosts.append(host)
for childgroup in group.children.all():