mirror of
https://github.com/ansible/awx.git
synced 2026-05-12 03:47:36 -02:30
Implement gathering overall task capacity
For use when running/planning jobs
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
import sys
|
||||
|
||||
from django.db import models
|
||||
from django.db.models import Sum
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
@@ -40,6 +41,9 @@ class InstanceManager(models.Manager):
|
||||
"""Return count of active Tower nodes for licensing."""
|
||||
return self.all().count()
|
||||
|
||||
def total_capacity(self):
|
||||
return self.aggregate(total_capacity=Sum('capacity'))['total_capacity']
|
||||
|
||||
def my_role(self):
|
||||
# NOTE: TODO: Likely to repurpose this once standalone ramparts are a thing
|
||||
return "tower"
|
||||
|
||||
Reference in New Issue
Block a user