mirror of
https://github.com/ansible/awx.git
synced 2026-03-01 08:48:46 -03:30
cleanup up some unused code/comments, and simplify the license migration
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
# Copyright (c) 2015 Ansible, Inc.
|
||||
# All Rights Reserved.
|
||||
|
||||
# from awx.main.utils.common import StubLicense
|
||||
#
|
||||
#
|
||||
# def test_stub_license():
|
||||
# license_actual = StubLicense().validate()
|
||||
# assert license_actual['license_key'] == 'OPEN'
|
||||
# assert license_actual['valid_key']
|
||||
# assert license_actual['compliant']
|
||||
# assert license_actual['license_type'] == 'open'
|
||||
|
||||
|
||||
|
||||
# Test license_date is always seconds
|
||||
@@ -201,7 +201,6 @@ def get_awx_http_client_headers():
|
||||
return headers
|
||||
|
||||
|
||||
# Update all references of this function in the codebase to just import `from awx.main.utils.licensing import Licenser` directly
|
||||
def get_licenser(*args, **kwargs):
|
||||
try:
|
||||
# Get License Config from db?
|
||||
|
||||
@@ -97,7 +97,7 @@ class Licenser(object):
|
||||
if 'company_name' in kwargs:
|
||||
kwargs.pop('company_name')
|
||||
self._attrs.update(kwargs)
|
||||
if self._check_product_cert():
|
||||
if os.path.exists('/var/lib/awx/.tower_version'):
|
||||
if 'license_key' in self._attrs:
|
||||
self._unset_attrs()
|
||||
if 'valid_key' in self._attrs:
|
||||
@@ -109,14 +109,6 @@ class Licenser(object):
|
||||
self._generate_open_config()
|
||||
|
||||
|
||||
def _check_product_cert(self):
|
||||
# Product Cert Name: ansible-tower-3.7-rhel-7.x86_64.pem
|
||||
# Maybe check validity of Product Cert somehow?
|
||||
if os.path.exists('/etc/tower/certs') and os.path.exists('/var/lib/awx/.tower_version'):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def _generate_open_config(self):
|
||||
self._attrs.update(dict(license_type='open',
|
||||
valid_key=True,
|
||||
@@ -130,11 +122,6 @@ class Licenser(object):
|
||||
self._attrs = self.UNLICENSED_DATA.copy()
|
||||
|
||||
|
||||
def _clear_license_setting(self):
|
||||
self.unset_attrs()
|
||||
settings.LICENSE = {}
|
||||
|
||||
|
||||
def license_from_manifest(self, manifest):
|
||||
# Parse output for subscription metadata to build config
|
||||
license = dict()
|
||||
|
||||
Reference in New Issue
Block a user