mirror of
https://github.com/ansible/awx.git
synced 2026-02-22 21:46:00 -03:30
Properly record the license type when sub is a trial
This commit is contained in:
@@ -90,8 +90,8 @@ class OpenLicense(object):
|
|||||||
|
|
||||||
|
|
||||||
class Licenser(object):
|
class Licenser(object):
|
||||||
# warn when there is a month (30 days) left on the license
|
# warn when there is a month (30 days) left on the subscription
|
||||||
LICENSE_TIMEOUT = 60 * 60 * 24 * 30
|
SUBSCRIPTION_TIMEOUT = 60 * 60 * 24 * 30
|
||||||
|
|
||||||
UNLICENSED_DATA = dict(
|
UNLICENSED_DATA = dict(
|
||||||
subscription_name=None,
|
subscription_name=None,
|
||||||
@@ -327,6 +327,7 @@ class Licenser(object):
|
|||||||
license._attrs['license_type'] = 'enterprise'
|
license._attrs['license_type'] = 'enterprise'
|
||||||
if sub.trial:
|
if sub.trial:
|
||||||
license._attrs['trial'] = True
|
license._attrs['trial'] = True
|
||||||
|
license._attrs['license_type'] = 'trial'
|
||||||
license._attrs['instance_count'] = min(
|
license._attrs['instance_count'] = min(
|
||||||
MAX_INSTANCES, license._attrs['instance_count']
|
MAX_INSTANCES, license._attrs['instance_count']
|
||||||
)
|
)
|
||||||
@@ -384,6 +385,6 @@ class Licenser(object):
|
|||||||
else:
|
else:
|
||||||
attrs['grace_period_remaining'] = (license_date + 2592000) - current_date
|
attrs['grace_period_remaining'] = (license_date + 2592000) - current_date
|
||||||
attrs['compliant'] = bool(time_remaining > 0 and free_instances >= 0)
|
attrs['compliant'] = bool(time_remaining > 0 and free_instances >= 0)
|
||||||
attrs['date_warning'] = bool(time_remaining < self.LICENSE_TIMEOUT)
|
attrs['date_warning'] = bool(time_remaining < self.SUBSCRIPTION_TIMEOUT)
|
||||||
attrs['date_expired'] = bool(time_remaining <= 0)
|
attrs['date_expired'] = bool(time_remaining <= 0)
|
||||||
return attrs
|
return attrs
|
||||||
|
|||||||
Reference in New Issue
Block a user