mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
Fix a typo in inventory_import
ExecutionEnvironment.credential got shortened to .cred.
This commit is contained in:
parent
58cdbca5cf
commit
010c3ab0b8
@ -82,13 +82,13 @@ class AnsibleInventoryLoader(object):
|
||||
ee = get_default_execution_environment()
|
||||
bargs.extend([ee.image])
|
||||
|
||||
if ee.cred:
|
||||
if not ee.cred.has_inputs(field_names=('host', 'username', 'password')):
|
||||
if ee.credential:
|
||||
if not ee.credential.has_inputs(field_names=('host', 'username', 'password')):
|
||||
raise RuntimeError(f"Registry credential for execution environment `{ee}` is missing either the host, username, or password.")
|
||||
|
||||
host = ee.cred.get_input('host')
|
||||
username = ee.cred.get_input('username')
|
||||
password = ee.cred.get_input('password')
|
||||
host = ee.credential.get_input('host')
|
||||
username = ee.credential.get_input('username')
|
||||
password = ee.credential.get_input('password')
|
||||
token = f"{username}:{password}"
|
||||
auth_data = {'auths': {host: {'auth': b64encode(token.encode('utf-8')).decode('utf-8')}}}
|
||||
self.authfile.write(json.dumps(auth_data, indent=4).encode('utf-8'))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user