From c9f0b5d46b17bc55182489150bd6cc6a0399d204 Mon Sep 17 00:00:00 2001 From: Chandan Kumar Date: Wed, 6 Jun 2018 13:54:35 +0530 Subject: [PATCH] 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 Change-Id: Ia9d070a6033a8192112dbaa1704b1de6838051c5 --- .../tests/scenario/barbican_manager.py | 12 ++++++------ barbican_tempest_plugin/tests/scenario/manager.py | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) 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 @@ class BarbicanScenarioTest(mgr.ScenarioTest): ) 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 66d28a5..391fe02 100644 --- a/barbican_tempest_plugin/tests/scenario/manager.py +++ b/barbican_tempest_plugin/tests/scenario/manager.py @@ -75,12 +75,12 @@ class ScenarioTest(manager.NetworkScenarioTest): 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 #