mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 16:51:11 +03:00
made licensing a warning and not trigger on periodic scheduler
This commit is contained in:
parent
0d365068ff
commit
a264b1db1f
@ -307,7 +307,7 @@ class BaseAccess(object):
|
|||||||
|
|
||||||
return True # User has access to both, permission check passed
|
return True # User has access to both, permission check passed
|
||||||
|
|
||||||
def check_license(self, add_host_name=None, feature=None, check_expiration=True):
|
def check_license(self, add_host_name=None, feature=None, check_expiration=True, quiet=False):
|
||||||
validation_info = get_licenser().validate()
|
validation_info = get_licenser().validate()
|
||||||
if validation_info.get('license_type', 'UNLICENSED') == 'open':
|
if validation_info.get('license_type', 'UNLICENSED') == 'open':
|
||||||
return
|
return
|
||||||
@ -317,8 +317,10 @@ class BaseAccess(object):
|
|||||||
validation_info['time_remaining'] = 99999999
|
validation_info['time_remaining'] = 99999999
|
||||||
validation_info['grace_period_remaining'] = 99999999
|
validation_info['grace_period_remaining'] = 99999999
|
||||||
|
|
||||||
report_violation = lambda message: logger.error(message)
|
if quiet:
|
||||||
|
report_violation = lambda message: None
|
||||||
|
else:
|
||||||
|
report_violation = lambda message: logger.warning(message)
|
||||||
if (
|
if (
|
||||||
validation_info.get('trial', False) is True or
|
validation_info.get('trial', False) is True or
|
||||||
validation_info['instance_count'] == 10 # basic 10 license
|
validation_info['instance_count'] == 10 # basic 10 license
|
||||||
|
@ -507,7 +507,7 @@ def awx_periodic_scheduler():
|
|||||||
|
|
||||||
invalid_license = False
|
invalid_license = False
|
||||||
try:
|
try:
|
||||||
access_registry[Job](None).check_license()
|
access_registry[Job](None).check_license(quiet=True)
|
||||||
except PermissionDenied as e:
|
except PermissionDenied as e:
|
||||||
invalid_license = e
|
invalid_license = e
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user