Merge pull request #8790 from rooftopcellist/quantity_not_exported

Aggregate quantity per sub allocation, not exported

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2020-12-08 21:52:49 +00:00 committed by GitHub
commit 8e46166313
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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