mirror of
https://github.com/ansible/awx.git
synced 2026-03-06 11:11:07 -03:30
Merge pull request #360 from ryanpetrello/license_type_check
update the license check command to return license type, not validity
This commit is contained in:
@@ -6,15 +6,8 @@ from django.core.management.base import NoArgsCommand
|
|||||||
|
|
||||||
|
|
||||||
class Command(NoArgsCommand):
|
class Command(NoArgsCommand):
|
||||||
"""Return 0 if licensed; 1 if unlicensed
|
"""Returns license type, e.g., 'enterprise', 'open', 'none'"""
|
||||||
"""
|
|
||||||
|
|
||||||
def handle(self, **options):
|
def handle(self, **options):
|
||||||
super(Command, self).__init__()
|
super(Command, self).__init__()
|
||||||
|
return get_licenser().validate().get('license_type', 'none')
|
||||||
license_info = get_licenser().validate()
|
|
||||||
if license_info['valid_key'] is True:
|
|
||||||
return 0
|
|
||||||
else:
|
|
||||||
return 1
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user