mirror of
https://github.com/ansible/awx.git
synced 2026-02-23 14:05:59 -03:30
Merge pull request #11546 from jbradberry/remove-instance-activecount
Remove the Instance.objects.active_count() method
This commit is contained in:
@@ -186,10 +186,6 @@ class InstanceManager(models.Manager):
|
|||||||
else:
|
else:
|
||||||
return (False, self.me())
|
return (False, self.me())
|
||||||
|
|
||||||
def active_count(self):
|
|
||||||
"""Return count of active Tower nodes for licensing."""
|
|
||||||
return self.exclude(node_type='hop').count()
|
|
||||||
|
|
||||||
|
|
||||||
class InstanceGroupManager(models.Manager):
|
class InstanceGroupManager(models.Manager):
|
||||||
"""A custom manager class for the Instance model.
|
"""A custom manager class for the Instance model.
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ def test_instance_dup(org_admin, organization, project, instance_factory, instan
|
|||||||
ig_all = instance_group_factory("all", instances=[i1, i2, i3])
|
ig_all = instance_group_factory("all", instances=[i1, i2, i3])
|
||||||
ig_dup = instance_group_factory("duplicates", instances=[i1])
|
ig_dup = instance_group_factory("duplicates", instances=[i1])
|
||||||
project.organization.instance_groups.add(ig_all, ig_dup)
|
project.organization.instance_groups.add(ig_all, ig_dup)
|
||||||
actual_num_instances = Instance.objects.active_count()
|
actual_num_instances = Instance.objects.count()
|
||||||
list_response = get(reverse('api:instance_list'), user=system_auditor)
|
list_response = get(reverse('api:instance_list'), user=system_auditor)
|
||||||
api_num_instances_auditor = list(list_response.data.items())[0][1]
|
api_num_instances_auditor = list(list_response.data.items())[0][1]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user