Added support of volume api_v3 client
* From rocky release projects are consuming the volume featured
enabled v3 API, Since the earlier code has support
for v1, v2 and since api_v3 is used in tempest.conf, it will give
AttributeError: 'Manager' object has no attribute 'volumes_client'.
The above patch fixes the issue.
* Keep cinder v1 api as tempest plugin is branchless, it would avoid
breakage if someone is still consuming it.
Closes-Bug: #1775353
Related-Prod: PRODX-00001
Change-Id: Ia9d070a6033a8192112dbaa1704b1de6838051c5
diff --git a/barbican_tempest_plugin/tests/scenario/barbican_manager.py b/barbican_tempest_plugin/tests/scenario/barbican_manager.py
index 2cf7a7f..8e5d7c4 100644
--- a/barbican_tempest_plugin/tests/scenario/barbican_manager.py
+++ b/barbican_tempest_plugin/tests/scenario/barbican_manager.py
@@ -81,16 +81,16 @@
)
if CONF.compute_feature_enabled.attach_encrypted_volume:
- if CONF.volume_feature_enabled.api_v2:
- cls.admin_volume_types_client =\
- os_adm.volume_types_v2_client
- cls.admin_encryption_types_client =\
- os_adm.encryption_types_v2_client
- else:
+ if CONF.volume_feature_enabled.api_v1:
cls.admin_volume_types_client =\
os_adm.volume_types_client
cls.admin_encryption_types_client =\
os_adm.encryption_types_client
+ else:
+ cls.admin_volume_types_client =\
+ os_adm.volume_types_v2_client
+ cls.admin_encryption_types_client =\
+ os_adm.encryption_types_v2_client
def _get_uuid(self, href):
return href.split('/')[-1]
diff --git a/barbican_tempest_plugin/tests/scenario/manager.py b/barbican_tempest_plugin/tests/scenario/manager.py
index 1aa009e..1afa10c 100644
--- a/barbican_tempest_plugin/tests/scenario/manager.py
+++ b/barbican_tempest_plugin/tests/scenario/manager.py
@@ -75,12 +75,12 @@
cls.security_group_rules_client = (
cls.os_primary.security_group_rules_client)
- if CONF.volume_feature_enabled.api_v2:
- cls.volumes_client = cls.os_primary.volumes_v2_client
- cls.snapshots_client = cls.os_primary.snapshots_v2_client
- else:
+ if CONF.volume_feature_enabled.api_v1:
cls.volumes_client = cls.os_primary.volumes_client
cls.snapshots_client = cls.os_primary.snapshots_client
+ else:
+ cls.volumes_client = cls.os_primary.volumes_client_latest
+ cls.snapshots_client = cls.os_primary.snapshots_client_latest
# ## Test functions library
#