Handle inventory types where Automation Hub collection names differ

Move imports added by Bill to be in-line, because utils should not import models at top

Remove more get_licenser inline imports
This commit is contained in:
Alan Rominger
2021-06-07 16:20:43 -04:00
parent 395af1b5e4
commit 21aa1fc11f
7 changed files with 41 additions and 40 deletions

View File

@@ -51,7 +51,6 @@ __all__ = [
'underscore_to_camelcase',
'memoize',
'memoize_delete',
'get_licenser',
'get_awx_http_client_headers',
'get_awx_version',
'update_scm_url',
@@ -255,18 +254,6 @@ def get_awx_http_client_headers():
return headers
def get_licenser(*args, **kwargs):
from awx.main.utils.licensing import Licenser, OpenLicense
try:
if os.path.exists('/var/lib/awx/.tower_version'):
return Licenser(*args, **kwargs)
else:
return OpenLicense()
except Exception as e:
raise ValueError(_('Error importing License: %s') % e)
def update_scm_url(scm_type, url, username=True, password=True, check_special_cases=True, scp_format=False):
"""
Update the given SCM URL to add/replace/remove the username/password. When