Merge "Add domain id information to identity-credentials"
This commit is contained in:
commit
3e86202e94
|
@ -1757,6 +1757,13 @@ def add_credentials_to_keystone(relation_id=None, remote_unit=None):
|
||||||
}
|
}
|
||||||
if domain:
|
if domain:
|
||||||
relation_data['domain'] = domain
|
relation_data['domain'] = domain
|
||||||
|
# The same domain is used for project and user creation. However, in
|
||||||
|
# the future they may not be.
|
||||||
|
domain_id = manager.resolve_domain_id(domain)
|
||||||
|
relation_data['credentials_user_domain_name'] = domain
|
||||||
|
relation_data['credentials_user_domain_id'] = domain_id
|
||||||
|
relation_data['credentials_project_domain_name'] = domain
|
||||||
|
relation_data['credentials_project_domain_id'] = domain_id
|
||||||
|
|
||||||
peer_store_and_set(relation_id=relation_id, **relation_data)
|
peer_store_and_set(relation_id=relation_id, **relation_data)
|
||||||
|
|
||||||
|
|
|
@ -1067,6 +1067,7 @@ class TestKeystoneUtils(CharmTestCase):
|
||||||
""" Verify add_credentials with Keystone V3 """
|
""" Verify add_credentials with Keystone V3 """
|
||||||
manager = MagicMock()
|
manager = MagicMock()
|
||||||
manager.resolve_tenant_id.return_value = 'abcdef0123456789'
|
manager.resolve_tenant_id.return_value = 'abcdef0123456789'
|
||||||
|
manager.resolve_domain_id.return_value = 'a-domain-id'
|
||||||
get_manager.return_value = manager
|
get_manager.return_value = manager
|
||||||
remote_unit = 'unit/0'
|
remote_unit = 'unit/0'
|
||||||
relation_id = 'identity-credentials:0'
|
relation_id = 'identity-credentials:0'
|
||||||
|
@ -1090,6 +1091,10 @@ class TestKeystoneUtils(CharmTestCase):
|
||||||
'credentials_password': 'password',
|
'credentials_password': 'password',
|
||||||
'credentials_project': 'services',
|
'credentials_project': 'services',
|
||||||
'credentials_project_id': 'abcdef0123456789',
|
'credentials_project_id': 'abcdef0123456789',
|
||||||
|
'credentials_user_domain_id': 'a-domain-id',
|
||||||
|
'credentials_project_domain_id': 'a-domain-id',
|
||||||
|
'credentials_project_domain_name': 'Non-Default',
|
||||||
|
'credentials_user_domain_name': 'Non-Default',
|
||||||
'region': 'RegionOne',
|
'region': 'RegionOne',
|
||||||
'domain': 'Non-Default',
|
'domain': 'Non-Default',
|
||||||
'api_version': 3}
|
'api_version': 3}
|
||||||
|
|
Loading…
Reference in New Issue