diff options
author | Sean Dague <sean@dague.net> | 2016-04-04 10:49:13 -0400 |
---|---|---|
committer | Andrea Frittoli (andreaf) <andrea.frittoli@hpe.com> | 2016-04-06 22:26:18 +0100 |
commit | ed6e586b9f8f0ada10af7711f297afa01b2b7754 (patch) | |
tree | 1fed2c438af65613b48556c13fa3f5ed36180de7 /tempest/common/credentials_factory.py | |
parent | fbca80d640646528e94ddf7fddef8d966db6f5d6 (diff) | |
download | tempest-ed6e586b9f8f0ada10af7711f297afa01b2b7754.tar.gz |
deprecate use of tenant in configs
OpenStack has settled (a very long time ago) on project to represent
the container which has users. We should make tempest configs always
use project versions of these names. This deprecates the old tenant
versions of these names, and makes project version the prefered
option.
Change-Id: Ied68c0326cf891a4e6eb3db51dc5f43241e4b8d2
Diffstat (limited to 'tempest/common/credentials_factory.py')
-rw-r--r-- | tempest/common/credentials_factory.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tempest/common/credentials_factory.py b/tempest/common/credentials_factory.py index 0ca14a9b6..58157efd7 100644 --- a/tempest/common/credentials_factory.py +++ b/tempest/common/credentials_factory.py @@ -256,7 +256,7 @@ def get_configured_credentials(credential_type, fill_in=True, if credential_type not in CREDENTIAL_TYPES: raise exceptions.InvalidCredentials() - conf_attributes = ['username', 'password', 'tenant_name'] + conf_attributes = ['username', 'password', 'project_name'] if identity_version == 'v3': conf_attributes.append('domain_name') @@ -269,6 +269,11 @@ def get_configured_credentials(credential_type, fill_in=True, params[attr] = getattr(_section, attr) else: params[attr] = getattr(_section, prefix + "_" + attr) + # NOTE(andreaf) v2 API still uses tenants, so we must translate project + # to tenant before building the Credentials object + if identity_version == 'v2': + params['tenant_name'] = params.get('project_name') + params.pop('project_name', None) # Build and validate credentials. We are reading configured credentials, # so validate them even if fill_in is False credentials = get_credentials(fill_in=fill_in, |