summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakemi Asakura <tasakura@redhat.com>2023-02-16 19:40:45 +0900
committerTakemi Asakura <tasakura@redhat.com>2023-03-01 19:44:15 +0900
commit30a269ceeefde605bbc8f9b68b65f99f30af9184 (patch)
tree0bda29e75451c423aad6b400ae921585a579b87e
parent5e9e677d8f7f78b8891bd625a36fe7e35a3f1696 (diff)
downloadtempest-30a269ceeefde605bbc8f9b68b65f99f30af9184.tar.gz
Cinder client fails if identity API version specified
The `CLIClient` class, which is used as an interface to various openstack related CLIs, however, the `--os-identity-api-version` option is not available outside of swift and openstack client. When `--os-identity-api-version` is used except for swift and openstack clients, the following fixes were made to prevent passing options to the client. - Add a statement in the `cmd_with_auth` method that `--os-identity-api-version` is used only for swift and openstack Closes-Bug: #1980252 Change-Id: I8cfe63551cadd2f773c7455786b01f12e4843796
-rw-r--r--tempest/lib/cli/base.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tempest/lib/cli/base.py b/tempest/lib/cli/base.py
index c661d21cd..c9cffd235 100644
--- a/tempest/lib/cli/base.py
+++ b/tempest/lib/cli/base.py
@@ -97,6 +97,10 @@ class CLIClient(object):
:type identity_api_version: string
"""
+ CLIENTS_WITHOUT_IDENTITY_VERSION = ['nova', 'nova_manage', 'keystone',
+ 'glance', 'ceilometer', 'heat',
+ 'cinder', 'neutron', 'sahara']
+
def __init__(self, username='', password='', tenant_name='', uri='',
cli_dir='', insecure=False, prefix='', user_domain_name=None,
user_domain_id=None, project_domain_name=None,
@@ -377,8 +381,9 @@ class CLIClient(object):
self.password,
self.uri))
if self.identity_api_version:
- creds += ' --os-identity-api-version %s' % (
- self.identity_api_version)
+ if cmd not in self.CLIENTS_WITHOUT_IDENTITY_VERSION:
+ creds += ' --os-identity-api-version %s' % (
+ self.identity_api_version)
if self.user_domain_name is not None:
creds += ' --os-user-domain-name %s' % self.user_domain_name
if self.user_domain_id is not None: