mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
include license data/state in the sosreport
This commit is contained in:
parent
f21c6dc330
commit
7a8234bb09
@ -1,6 +1,8 @@
|
||||
# Copyright (c) 2015 Ansible, Inc.
|
||||
# All Rights Reserved
|
||||
|
||||
import json
|
||||
|
||||
from awx.main.utils import get_licenser
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
@ -8,6 +10,15 @@ from django.core.management.base import BaseCommand
|
||||
class Command(BaseCommand):
|
||||
"""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):
|
||||
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 list_instances", # tower cluster configuration
|
||||
"awx-manage run_dispatcher --status", # tower dispatch worker status
|
||||
"awx-manage check_license --data", # tower license 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 -l", # pip package list without globally-installed packages
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user