summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-04-16 14:28:02 +0000
committerGerrit Code Review <review@openstack.org>2015-04-16 14:28:02 +0000
commit347defda0e9d7086392c8651054aa10ab1cc5fa5 (patch)
tree696d48d5778e31a49a791e0ba574a67f390c3ae9
parentf87059b8da149f790ce2670fb4782eaa227482c8 (diff)
parentf39f9f31f2b04d3cec2d3df9242134bc645e5e53 (diff)
downloadtempest-347defda0e9d7086392c8651054aa10ab1cc5fa5.tar.gz
Merge "FIx Accounts with identity v3 and v2 data in yaml"
-rw-r--r--tempest/common/accounts.py11
-rw-r--r--tempest/common/cred_provider.py2
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: