diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-07-15 20:58:19 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-07-15 20:58:19 +0000 |
| commit | d96cc9fc08caa51a2f7bdab47d0546fdbc00f495 (patch) | |
| tree | 18590ebfecd99df47bead8ba828f8ee10210632e | |
| parent | e2f2242d400decfd1f3294f077148b42e0e88c84 (diff) | |
| parent | 426055c48e3afcdb4aa5b68b7247a074e2f8ddf5 (diff) | |
| download | python-cinderclient-d96cc9fc08caa51a2f7bdab47d0546fdbc00f495.tar.gz | |
Merge "OS_TENANT_NAME is not required when we have OS_PROJECT_NAME"
| -rw-r--r-- | cinderclient/shell.py | 8 | ||||
| -rw-r--r-- | cinderclient/tests/functional/base.py | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/cinderclient/shell.py b/cinderclient/shell.py index 287bc0f..e18b848 100644 --- a/cinderclient/shell.py +++ b/cinderclient/shell.py @@ -269,6 +269,7 @@ class OpenStackCinderShell(object): parser.add_argument('--os-tenant-name', metavar='<auth-tenant-name>', default=utils.env('OS_TENANT_NAME', + 'OS_PROJECT_NAME', 'CINDER_PROJECT_ID'), help='Tenant name. ' 'Default=env[OS_TENANT_NAME].') @@ -278,6 +279,7 @@ class OpenStackCinderShell(object): parser.add_argument('--os-tenant-id', metavar='<auth-tenant-id>', default=utils.env('OS_TENANT_ID', + 'OS_PROJECT_ID', 'CINDER_TENANT_ID'), help='ID for the tenant. ' 'Default=env[OS_TENANT_ID].') @@ -739,8 +741,10 @@ class OpenStackCinderShell(object): username = self.options.os_username password = self.options.os_password - tenant_id = self.options.os_tenant_id - tenant_name = self.options.os_tenant_name + tenant_id = (self.options.os_tenant_id + or self.options.os_project_id) + tenant_name = (self.options.os_tenant_name + or self.options.os_project_name) return v2_auth.Password( v2_auth_url, diff --git a/cinderclient/tests/functional/base.py b/cinderclient/tests/functional/base.py index de8f665..8b291b6 100644 --- a/cinderclient/tests/functional/base.py +++ b/cinderclient/tests/functional/base.py @@ -34,7 +34,8 @@ def credentials(): username = os.environ.get('OS_USERNAME') password = os.environ.get('OS_PASSWORD') - tenant_name = os.environ.get('OS_TENANT_NAME') + tenant_name = (os.environ.get('OS_TENANT_NAME') + or os.environ.get('OS_PROJECT_NAME')) auth_url = os.environ.get('OS_AUTH_URL') config = six.moves.configparser.RawConfigParser() |
