mirror of
https://github.com/ansible/awx.git
synced 2026-03-18 01:17:35 -02:30
Merge pull request #5665 from wenottingham/warn-only
Only warn when license is exceeded non-fatally Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
@@ -921,11 +921,14 @@ class Command(BaseCommand):
|
|||||||
available_instances = license_info.get('available_instances', 0)
|
available_instances = license_info.get('available_instances', 0)
|
||||||
free_instances = license_info.get('free_instances', 0)
|
free_instances = license_info.get('free_instances', 0)
|
||||||
time_remaining = license_info.get('time_remaining', 0)
|
time_remaining = license_info.get('time_remaining', 0)
|
||||||
|
hard_error = license_info.get('trial', False) is True or license_info['instance_count'] == 10
|
||||||
new_count = Host.objects.active_count()
|
new_count = Host.objects.active_count()
|
||||||
if time_remaining <= 0 and not license_info.get('demo', False):
|
if time_remaining <= 0:
|
||||||
logger.error(LICENSE_EXPIRED_MESSAGE)
|
if hard_error:
|
||||||
if license_info.get('trial', False) is True:
|
logger.error(LICENSE_EXPIRED_MESSAGE)
|
||||||
raise CommandError("License has expired!")
|
raise CommandError("License has expired!")
|
||||||
|
else:
|
||||||
|
logger.warning(LICENSE_EXPIRED_MESSAGE)
|
||||||
# special check for tower-type inventory sources
|
# special check for tower-type inventory sources
|
||||||
# but only if running the plugin
|
# but only if running the plugin
|
||||||
TOWER_SOURCE_FILES = ['tower.yml', 'tower.yaml']
|
TOWER_SOURCE_FILES = ['tower.yml', 'tower.yaml']
|
||||||
@@ -938,15 +941,11 @@ class Command(BaseCommand):
|
|||||||
'new_count': new_count,
|
'new_count': new_count,
|
||||||
'available_instances': available_instances,
|
'available_instances': available_instances,
|
||||||
}
|
}
|
||||||
if license_info.get('demo', False):
|
if hard_error:
|
||||||
logger.error(DEMO_LICENSE_MESSAGE % d)
|
|
||||||
else:
|
|
||||||
logger.error(LICENSE_MESSAGE % d)
|
logger.error(LICENSE_MESSAGE % d)
|
||||||
if (
|
|
||||||
license_info.get('trial', False) is True or
|
|
||||||
license_info['instance_count'] == 10 # basic 10 license
|
|
||||||
):
|
|
||||||
raise CommandError('License count exceeded!')
|
raise CommandError('License count exceeded!')
|
||||||
|
else:
|
||||||
|
logger.warning(LICENSE_MESSAGE % d)
|
||||||
|
|
||||||
def check_org_host_limit(self):
|
def check_org_host_limit(self):
|
||||||
license_info = get_licenser().validate()
|
license_info = get_licenser().validate()
|
||||||
|
|||||||
Reference in New Issue
Block a user