From 30a269ceeefde605bbc8f9b68b65f99f30af9184 Mon Sep 17 00:00:00 2001 From: Takemi Asakura Date: Thu, 16 Feb 2023 19:40:45 +0900 Subject: [PATCH] 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 --- tempest/lib/cli/base.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tempest/lib/cli/base.py b/tempest/lib/cli/base.py index c661d21cda..c9cffd2359 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: