From b81f082a184d85e4bad11cce21d99f8e8c5bd048 Mon Sep 17 00:00:00 2001 From: "Christian M. Adams" Date: Tue, 8 Dec 2020 13:44:03 -0500 Subject: [PATCH] Aggregate quantity per sub allocation, not exported * The exported field shows total quantity exported to a manifest for a given sub. We want to sum the quantities of each sub allocation in a manifest instead. --- awx/main/utils/licensing.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/awx/main/utils/licensing.py b/awx/main/utils/licensing.py index b749df8723..9b248536b5 100644 --- a/awx/main/utils/licensing.py +++ b/awx/main/utils/licensing.py @@ -183,10 +183,7 @@ class Licenser(object): currentEndDate = datetime.fromtimestamp(int(currentEndDateStr), timezone.utc) if endDate < currentEndDate: license['license_date'] = endDate.strftime('%s') - try: - instances = sub['pool']['exported'] - except KeyError: - instances = sub['pool']['quantity'] + instances = sub['quantity'] license['instance_count'] = license.get('instance_count', 0) + instances license['subscription_name'] = re.sub(r'[\d]* Managed Nodes', '%d Managed Nodes' % license['instance_count'], license['subscription_name'])