mirror of
https://github.com/ansible/awx.git
synced 2026-02-17 03:00:04 -03:30
fix incorrect detection of license on inventory updates
This commit is contained in:
@@ -903,7 +903,7 @@ class Command(BaseCommand):
|
|||||||
def check_license(self):
|
def check_license(self):
|
||||||
license_info = get_licenser().validate()
|
license_info = get_licenser().validate()
|
||||||
local_license_type = license_info.get('license_type', 'UNLICENSED')
|
local_license_type = license_info.get('license_type', 'UNLICENSED')
|
||||||
if license_info.get('license_key', 'UNLICENSED') == 'UNLICENSED':
|
if local_license_type == 'UNLICENSED':
|
||||||
logger.error(LICENSE_NON_EXISTANT_MESSAGE)
|
logger.error(LICENSE_NON_EXISTANT_MESSAGE)
|
||||||
raise CommandError('No license found!')
|
raise CommandError('No license found!')
|
||||||
elif local_license_type == 'open':
|
elif local_license_type == 'open':
|
||||||
|
|||||||
@@ -99,8 +99,6 @@ class Licenser(object):
|
|||||||
kwargs.pop('company_name')
|
kwargs.pop('company_name')
|
||||||
self._attrs.update(kwargs)
|
self._attrs.update(kwargs)
|
||||||
if os.path.exists('/var/lib/awx/.tower_version'):
|
if os.path.exists('/var/lib/awx/.tower_version'):
|
||||||
if 'license_key' in self._attrs:
|
|
||||||
self._unset_attrs()
|
|
||||||
if 'valid_key' in self._attrs:
|
if 'valid_key' in self._attrs:
|
||||||
if not self._attrs['valid_key']:
|
if not self._attrs['valid_key']:
|
||||||
self._unset_attrs()
|
self._unset_attrs()
|
||||||
|
|||||||
Reference in New Issue
Block a user