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
This commit is contained in:
Ryan Petrello 2017-08-29 15:04:16 -04:00
parent c2d59e4815
commit beae7ffa20
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777

View File

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