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.
This commit is contained in:
Christian M. Adams 2020-12-08 13:44:03 -05:00
parent 5e51dd2ff7
commit b81f082a18

View File

@ -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'])