mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 05:29:26 -02:30
include license data/state in the sosreport
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
# Copyright (c) 2015 Ansible, Inc.
|
# Copyright (c) 2015 Ansible, Inc.
|
||||||
# All Rights Reserved
|
# All Rights Reserved
|
||||||
|
|
||||||
|
import json
|
||||||
|
|
||||||
from awx.main.utils import get_licenser
|
from awx.main.utils import get_licenser
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
|
|
||||||
@@ -8,6 +10,15 @@ from django.core.management.base import BaseCommand
|
|||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
"""Returns license type, e.g., 'enterprise', 'open', 'none'"""
|
"""Returns license type, e.g., 'enterprise', 'open', 'none'"""
|
||||||
|
|
||||||
|
def add_arguments(self, parser):
|
||||||
|
parser.add_argument('--data', dest='data', action='store_true',
|
||||||
|
help='verbose, prints the actual (sanitized) license')
|
||||||
|
|
||||||
def handle(self, *args, **options):
|
def handle(self, *args, **options):
|
||||||
super(Command, self).__init__()
|
super(Command, self).__init__()
|
||||||
return get_licenser().validate().get('license_type', 'none')
|
license = get_licenser().validate()
|
||||||
|
if options.get('data'):
|
||||||
|
if license.get('license_key', '') != 'UNLICENSED':
|
||||||
|
license['license_key'] = '********'
|
||||||
|
return json.dumps(license)
|
||||||
|
return license.get('license_type', 'none')
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ SOSREPORT_TOWER_COMMANDS = [
|
|||||||
"awx-manage --version", # tower version
|
"awx-manage --version", # tower version
|
||||||
"awx-manage list_instances", # tower cluster configuration
|
"awx-manage list_instances", # tower cluster configuration
|
||||||
"awx-manage run_dispatcher --status", # tower dispatch worker status
|
"awx-manage run_dispatcher --status", # tower dispatch worker status
|
||||||
|
"awx-manage check_license --data", # tower license status
|
||||||
"supervisorctl status", # tower process status
|
"supervisorctl status", # tower process status
|
||||||
"/var/lib/awx/venv/awx/bin/pip freeze", # pip package list
|
"/var/lib/awx/venv/awx/bin/pip freeze", # pip package list
|
||||||
"/var/lib/awx/venv/awx/bin/pip freeze -l", # pip package list without globally-installed packages
|
"/var/lib/awx/venv/awx/bin/pip freeze -l", # pip package list without globally-installed packages
|
||||||
|
|||||||
Reference in New Issue
Block a user