properly filter disabled hosts on smart inventory composition

see: https://github.com/ansible/tower/issues/1053
This commit is contained in:
Ryan Petrello
2018-03-28 15:16:26 -04:00
parent ae5d17d151
commit 23267bce38

View File

@@ -233,7 +233,7 @@ class Inventory(CommonModelNameNotUnique, ResourceMixin, RelatedJobsMixin):
return {}
else:
all_group = data.setdefault('all', dict())
smart_hosts_qs = self.hosts.all()
smart_hosts_qs = self.hosts.filter(**hosts_q).all()
smart_hosts = list(smart_hosts_qs.values_list('name', flat=True))
all_group['hosts'] = smart_hosts
else: