Skip to content

Commit

Permalink
Merge pull request #889 from rodrigogansobarbieri/zed_fix-image-volum…
Browse files Browse the repository at this point in the history
…e-ambiguous-configuration

[Zed] Set service_user_id from keystone relation
  • Loading branch information
ajkavanagh authored Apr 5, 2024
2 parents 55d7711 + 57331d4 commit d8acf38
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion charmhelpers/contrib/openstack/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ def _resolve(key):
'internal_auth_url': internal_auth_url,
})

# we keep all veriables in ctxt for compatibility and
# we keep all variables in ctxt for compatibility and
# add nested dictionary for keystone_authtoken generic
# templating
if keystonemiddleware_os_release:
Expand All @@ -557,6 +557,7 @@ def _resolve(key):
# NOTE(jamespage) this is required for >= icehouse
# so a missing value just indicates keystone needs
# upgrading
ctxt['admin_user_id'] = _resolve('service_user_id')
ctxt['admin_tenant_id'] = _resolve('service_tenant_id')
ctxt['admin_domain_id'] = _resolve('service_domain_id')
return ctxt
Expand Down
10 changes: 10 additions & 0 deletions tests/contrib/openstack/test_os_contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,7 @@ def test_identity_service_context_with_data(self, *args):
'admin_tenant_id': None,
'admin_domain_id': None,
'admin_user': 'adam',
'admin_user_id': None,
'auth_host': 'keystone-host.local',
'auth_port': '35357',
'auth_protocol': 'http',
Expand Down Expand Up @@ -1129,6 +1130,7 @@ def test_identity_service_context_with_altname(self, *args):
'admin_tenant_id': None,
'admin_domain_id': None,
'admin_user': 'adam',
'admin_user_id': None,
'auth_host': 'keystone-host.local',
'auth_port': '35357',
'auth_protocol': 'http',
Expand Down Expand Up @@ -1161,6 +1163,7 @@ def test_identity_service_context_with_cache(self, *args):
'admin_tenant_id': None,
'admin_domain_id': None,
'admin_user': 'adam',
'admin_user_id': None,
'auth_host': 'keystone-host.local',
'auth_port': '35357',
'auth_protocol': 'http',
Expand Down Expand Up @@ -1192,6 +1195,7 @@ def test_identity_service_context_with_data_http(self, *args):
'admin_tenant_id': '123456',
'admin_domain_id': None,
'admin_user': 'adam',
'admin_user_id': None,
'auth_host': 'keystone-host.local',
'auth_port': '35357',
'auth_protocol': 'http',
Expand Down Expand Up @@ -1222,6 +1226,7 @@ def test_identity_service_context_with_data_https(self, *args):
'admin_tenant_id': None,
'admin_domain_id': None,
'admin_user': 'adam',
'admin_user_id': None,
'auth_host': 'keystone-host.local',
'auth_port': '35357',
'auth_protocol': 'https',
Expand Down Expand Up @@ -1256,6 +1261,7 @@ def test_identity_service_app_context_with_data_http(self, *args):
'service_project_id': 'svc-proj-id',
'service_domain_id': 'svc-dom-id',
'admin_user': 'svc-user-name',
'admin_user_id': 'svc-user-id',
'auth_host': 'keystoneadmin.local',
'auth_port': '5000',
'auth_protocol': 'http',
Expand Down Expand Up @@ -1298,6 +1304,7 @@ def test_identity_service_app_context_with_app_data_nones(self, *args):
'service_project_id': 'svc-proj-id',
'service_domain_id': 'svc-dom-id',
'admin_user': 'adam', # comes from the relation data
'admin_user_id': 'svc-user-id',
'auth_host': 'keystoneadmin.local',
'auth_port': '5000',
'auth_protocol': 'http',
Expand Down Expand Up @@ -1334,6 +1341,7 @@ def test_identity_service_context_with_data_versioned(self, *args):
'service_project_id': 'svc-proj-id',
'service_domain_id': 'svc-dom-id',
'admin_user': 'adam',
'admin_user_id': None,
'auth_host': 'keystone-host.local',
'auth_port': '35357',
'auth_protocol': 'https',
Expand Down Expand Up @@ -1365,6 +1373,7 @@ def test_identity_service_context_with_admin_role(self, *args):
'admin_tenant_id': None,
'admin_domain_id': None,
'admin_user': 'adam',
'admin_user_id': None,
'auth_host': 'keystone-host.local',
'auth_port': '35357',
'auth_protocol': 'https',
Expand Down Expand Up @@ -1421,6 +1430,7 @@ def test_identity_service_context_with_ipv6(self, format_ipv6_addr, *args):
'admin_tenant_id': '123456',
'admin_domain_id': None,
'admin_user': 'adam',
'admin_user_id': None,
'auth_host': '[2001:db8:1::1]',
'auth_port': '35357',
'auth_protocol': 'http',
Expand Down

0 comments on commit d8acf38

Please sign in to comment.