From 010c3ab0b8a91b3ea4a9973f1a3dbc6e0d4e860d Mon Sep 17 00:00:00 2001 From: Jeff Bradberry Date: Wed, 27 Oct 2021 10:36:20 -0400 Subject: [PATCH] Fix a typo in inventory_import ExecutionEnvironment.credential got shortened to .cred. --- awx/main/management/commands/inventory_import.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/awx/main/management/commands/inventory_import.py b/awx/main/management/commands/inventory_import.py index 43c6671bda..ddd7f9cd83 100644 --- a/awx/main/management/commands/inventory_import.py +++ b/awx/main/management/commands/inventory_import.py @@ -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'))