From 0ddf47740cb7af608a8d6faecb248bd38e125fbb Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Thu, 22 Oct 2020 16:07:13 -0400 Subject: [PATCH] fix incorrect detection of license on inventory updates --- awx/main/management/commands/inventory_import.py | 2 +- awx/main/utils/licensing.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/awx/main/management/commands/inventory_import.py b/awx/main/management/commands/inventory_import.py index f4431b2705..c92215560e 100644 --- a/awx/main/management/commands/inventory_import.py +++ b/awx/main/management/commands/inventory_import.py @@ -903,7 +903,7 @@ class Command(BaseCommand): def check_license(self): license_info = get_licenser().validate() 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) raise CommandError('No license found!') elif local_license_type == 'open': diff --git a/awx/main/utils/licensing.py b/awx/main/utils/licensing.py index b209df4abc..67d3a4e4d0 100644 --- a/awx/main/utils/licensing.py +++ b/awx/main/utils/licensing.py @@ -99,8 +99,6 @@ class Licenser(object): kwargs.pop('company_name') self._attrs.update(kwargs) 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 not self._attrs['valid_key']: self._unset_attrs()