From: Lovejeet Singh Date: Mon, 13 Feb 2023 10:45:40 +0000 (+0530) Subject: Bug 2202: Adding support for cinder V3 API with V2 API for persistent volumes. X-Git-Tag: release-v14.0-start~24 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F56%2F12956%2F2;p=osm%2FRO.git Bug 2202: Adding support for cinder V3 API with V2 API for persistent volumes. Change-Id: I7034564b91b94e6be242cb2ce0f4a5b147b87d64 Signed-off-by: Lovejeet Singh --- diff --git a/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py b/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py index 9faf98d4..959839f6 100644 --- a/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py +++ b/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py @@ -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 index 00000000..60b67e34 --- /dev/null +++ b/releasenotes/notes/fix_bug_2202-b30df4eda9acb214.yaml @@ -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 +