Bug 2202: Adding support for cinder V3 API with V2 API for persistent volumes. 56/12956/2
authorLovejeet Singh <lovejeet.singh@hsc.com>
Mon, 13 Feb 2023 10:45:40 +0000 (16:15 +0530)
committerGulsum Atici <gulsum.atici@canonical.com>
Tue, 14 Feb 2023 21:17:58 +0000 (00:17 +0300)
Change-Id: I7034564b91b94e6be242cb2ce0f4a5b147b87d64
Signed-off-by: Lovejeet Singh <lovejeet.singh@hsc.com>
RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py
releasenotes/notes/fix_bug_2202-b30df4eda9acb214.yaml [new file with mode: 0644]

index 9faf98d..959839f 100644 (file)
@@ -355,12 +355,21 @@ class vimconnector(vimconn.VimConnector):
                 endpoint_type=self.endpoint_type,
                 region_name=region_name,
             )
-            self.cinder = self.session["cinder"] = cClient.Client(
-                2,
-                session=sess,
-                endpoint_type=self.endpoint_type,
-                region_name=region_name,
-            )
+
+            if sess.get_all_version_data(service_type="volumev2"):
+                self.cinder = self.session["cinder"] = cClient.Client(
+                    2,
+                    session=sess,
+                    endpoint_type=self.endpoint_type,
+                    region_name=region_name,
+                )
+            else:
+                self.cinder = self.session["cinder"] = cClient.Client(
+                    3,
+                    session=sess,
+                    endpoint_type=self.endpoint_type,
+                    region_name=region_name,
+                )
 
             try:
                 self.my_tenant_id = self.session["my_tenant_id"] = sess.get_project_id()
diff --git a/releasenotes/notes/fix_bug_2202-b30df4eda9acb214.yaml b/releasenotes/notes/fix_bug_2202-b30df4eda9acb214.yaml
new file mode 100644 (file)
index 0000000..60b67e3
--- /dev/null
@@ -0,0 +1,21 @@
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+---
+fixes:
+  - |
+    Fix Bug 2202 Adding support for cinder V3 API with V2 API for persistent volumes
+