Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[antelope] Set service_user_id from keystone relation #879

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading