mirror of
https://github.com/ansible/awx.git
synced 2026-03-06 11:11:07 -03:30
Revert isinstance, circular imports due to when the HostManager exists for an Inventory
This commit is contained in:
@@ -11,6 +11,8 @@ from django.conf import settings
|
|||||||
|
|
||||||
from awx.main.utils.filters import DynamicFilter
|
from awx.main.utils.filters import DynamicFilter
|
||||||
|
|
||||||
|
___all__ = ['HostManager', 'InstanceManager']
|
||||||
|
|
||||||
|
|
||||||
class HostManager(models.Manager):
|
class HostManager(models.Manager):
|
||||||
"""Custom manager class for Hosts model."""
|
"""Custom manager class for Hosts model."""
|
||||||
@@ -27,7 +29,9 @@ class HostManager(models.Manager):
|
|||||||
set. Use the `host_filter` to generate the queryset for the hosts.
|
set. Use the `host_filter` to generate the queryset for the hosts.
|
||||||
"""
|
"""
|
||||||
qs = super(HostManager, self).get_queryset()
|
qs = super(HostManager, self).get_queryset()
|
||||||
if hasattr(self, 'instance') and isinstance(self.instance, models.Inventory):
|
if (hasattr(self, 'instance') and
|
||||||
|
hasattr(self.instance, 'host_filter') and
|
||||||
|
hasattr(self.instance, 'kind')):
|
||||||
if self.instance.kind == 'dynamic' and self.instance.host_filter is not None:
|
if self.instance.kind == 'dynamic' and self.instance.host_filter is not None:
|
||||||
q = DynamicFilter.query_from_string(self.instance.host_filter)
|
q = DynamicFilter.query_from_string(self.instance.host_filter)
|
||||||
# If we are using host_filters, disable the core_filters, this allows
|
# If we are using host_filters, disable the core_filters, this allows
|
||||||
|
|||||||
Reference in New Issue
Block a user