mirror of
https://github.com/ansible/awx.git
synced 2026-05-15 05:17:36 -02:30
Fix for AC-321. Mark hosts and groups inactive when inventory is marked inactive.
This commit is contained in:
@@ -168,6 +168,16 @@ class Inventory(CommonModel):
|
||||
def get_absolute_url(self):
|
||||
return reverse('main:inventory_detail', args=(self.pk,))
|
||||
|
||||
def mark_inactive(self, save=True):
|
||||
'''
|
||||
When marking inventory inactive, also mark hosts and groups inactive.
|
||||
'''
|
||||
super(Inventory, self).mark_inactive(save=save)
|
||||
for host in self.hosts.filter(active=True):
|
||||
host.mark_inactive()
|
||||
for group in self.groups.filter(active=True):
|
||||
group.mark_inactive()
|
||||
|
||||
@property
|
||||
def variables_dict(self):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user