From 08323a11b631b9e24ada40aed70af36915dd20a4 Mon Sep 17 00:00:00 2001 From: Dave Lewis Date: Thu, 23 Apr 2020 11:24:51 +0100 Subject: [PATCH] Addition of project domain name to OpenStack Credential Keystone v3 requires user_domain_id and project_domain_name to authenticate, but AWX openstack credential only requests the user_domain_id. Added in project_domain_name into the credential templating. Not added as a required field as this is only needed when using Keystone v3. --- awx/main/models/credential/__init__.py | 4 ++++ awx/main/models/credential/injectors.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/awx/main/models/credential/__init__.py b/awx/main/models/credential/__init__.py index 1701c1fb24..85800b4029 100644 --- a/awx/main/models/credential/__init__.py +++ b/awx/main/models/credential/__init__.py @@ -799,6 +799,10 @@ ManagedCredentialType( 'id': 'project', 'label': ugettext_noop('Project (Tenant Name)'), 'type': 'string', + }, { + 'id': 'project_domain_name', + 'label': ugettext_noop('Project (Domain Name)'), + 'type': 'string', }, { 'id': 'domain', 'label': ugettext_noop('Domain Name'), diff --git a/awx/main/models/credential/injectors.py b/awx/main/models/credential/injectors.py index cdf193f8e9..3dd3838cc4 100644 --- a/awx/main/models/credential/injectors.py +++ b/awx/main/models/credential/injectors.py @@ -76,7 +76,8 @@ def _openstack_data(cred): openstack_auth = dict(auth_url=cred.get_input('host', default=''), username=cred.get_input('username', default=''), password=cred.get_input('password', default=''), - project_name=cred.get_input('project', default='')) + project_name=cred.get_input('project', default=''), + project_domain_name=cred.get_input('project_domain_name')) if cred.has_input('domain'): openstack_auth['domain_name'] = cred.get_input('domain', default='') verify_state = cred.get_input('verify_ssl', default=True)