From beae7ffa20cfc6f6116178681c0cdf25cb4c9705 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Tue, 29 Aug 2017 15:04:16 -0400 Subject: [PATCH] update the license check command to return license type, not validity we care about preventing upgradability from AWX installs w/ the open source license, not general license validity see: https://github.com/ansible/ansible-tower/issues/6555 --- awx/main/management/commands/check_license.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/awx/main/management/commands/check_license.py b/awx/main/management/commands/check_license.py index 8b67bd71e6..11b3b5cc9c 100644 --- a/awx/main/management/commands/check_license.py +++ b/awx/main/management/commands/check_license.py @@ -6,15 +6,8 @@ from django.core.management.base import NoArgsCommand class Command(NoArgsCommand): - """Return 0 if licensed; 1 if unlicensed - """ + """Returns license type, e.g., 'enterprise', 'open', 'none'""" def handle(self, **options): super(Command, self).__init__() - - license_info = get_licenser().validate() - if license_info['valid_key'] is True: - return 0 - else: - return 1 - + return get_licenser().validate().get('license_type', 'none')