Fix Openstack credential region implementation.

The injector wasn't using the same variable name as the model.
This commit is contained in:
Bill Nottingham 2021-02-12 16:44:19 -05:00
parent 67f1f9ac69
commit e93518a030
4 changed files with 6 additions and 5 deletions

View File

@ -92,8 +92,8 @@ def _openstack_data(cred):
},
}
if cred.has_input('project_region_name'):
openstack_data['clouds']['devstack']['region_name'] = cred.get_input('project_region_name', default='')
if cred.has_input('region'):
openstack_data['clouds']['devstack']['region_name'] = cred.get_input('region', default='')
return openstack_data

View File

@ -8,4 +8,5 @@ clouds:
project_name: fooo
username: fooo
private: true
region_name: fooo
verify: false

View File

@ -249,7 +249,7 @@ def test_openstack_client_config_generation_with_project_domain_name(mocker, sou
@pytest.mark.parametrize("source,expected", [
(None, True), (False, False), (True, True)
])
def test_openstack_client_config_generation_with_project_region_name(mocker, source, expected, private_data_dir):
def test_openstack_client_config_generation_with_region(mocker, source, expected, private_data_dir):
update = tasks.RunInventoryUpdate()
credential_type = CredentialType.defaults['openstack']()
inputs = {
@ -259,7 +259,7 @@ def test_openstack_client_config_generation_with_project_region_name(mocker, sou
'project': 'demo-project',
'domain': 'my-demo-domain',
'project_domain_name': 'project-domain',
'project_region_name': 'region-name',
'region': 'region-name',
}
if source is not None:
inputs['verify_ssl'] = source

View File

@ -276,7 +276,7 @@
"help_text": "OpenStack domains define administrative boundaries. It is only needed for Keystone v3 authentication URLs. Refer to Ansible Tower documentation for common scenarios."
},
{
"id": "project_region_name",
"id": "region",
"label": "Region Name",
"type": "string"
},