diff options
-rw-r--r-- | tempest/common/accounts.py | 11 | ||||
-rw-r--r-- | tempest/common/cred_provider.py | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/tempest/common/accounts.py b/tempest/common/accounts.py index 6d376d628..1d5516f27 100644 --- a/tempest/common/accounts.py +++ b/tempest/common/accounts.py @@ -190,8 +190,15 @@ class Accounts(cred_provider.CredentialProvider): def get_hash(self, creds): for _hash in self.hash_dict['creds']: # Comparing on the attributes that are expected in the YAML - if all([getattr(creds, k) == self.hash_dict['creds'][_hash][k] for - k in creds.get_init_attributes()]): + init_attributes = creds.get_init_attributes() + hash_attributes = self.hash_dict['creds'][_hash].copy() + if ('user_domain_name' in init_attributes and 'user_domain_name' + not in hash_attributes): + # Allow for the case of domain_name populated from config + domain_name = CONF.identity.admin_domain_name + hash_attributes['user_domain_name'] = domain_name + if all([getattr(creds, k) == hash_attributes[k] for + k in init_attributes]): return _hash raise AttributeError('Invalid credentials %s' % creds) diff --git a/tempest/common/cred_provider.py b/tempest/common/cred_provider.py index 2c6763df2..32230276e 100644 --- a/tempest/common/cred_provider.py +++ b/tempest/common/cred_provider.py @@ -84,6 +84,8 @@ def get_credentials(fill_in=True, identity_version=None, **kwargs): domain_fields = set(x for x in auth.KeystoneV3Credentials.ATTRIBUTES if 'domain' in x) if not domain_fields.intersection(kwargs.keys()): + # TODO(andreaf) It might be better here to use a dedicated config + # option such as CONF.auth.tenant_isolation_domain_name params['user_domain_name'] = CONF.identity.admin_domain_name auth_url = CONF.identity.uri_v3 else: |