mirror of
https://github.com/ansible/awx.git
synced 2026-03-11 22:49:32 -02:30
Merge pull request #151 from chrismeyersfsu/fix-6555_2
lay the foundation for checking license on upgrade
This commit is contained in:
20
awx/main/management/commands/check_license.py
Normal file
20
awx/main/management/commands/check_license.py
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# Copyright (c) 2015 Ansible, Inc.
|
||||||
|
# All Rights Reserved
|
||||||
|
|
||||||
|
from awx.main.utils import get_licenser
|
||||||
|
from django.core.management.base import NoArgsCommand
|
||||||
|
|
||||||
|
|
||||||
|
class Command(NoArgsCommand):
|
||||||
|
"""Return 0 if licensed; 1 if unlicensed
|
||||||
|
"""
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
Reference in New Issue
Block a user