1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 16:51:11 +03:00

Merge pull request #5750 from gamuniz/license_errors_begone

made licensing a warning and not trigger on periodic scheduler

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2020-01-24 14:49:55 +00:00 committed by GitHub
commit 65f226960f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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