From 368fe9739ea8c30a2890f1d85ea2bb79107a42f3 Mon Sep 17 00:00:00 2001 From: "bhagyashree.sarawate" Date: Wed, 21 Aug 2019 16:05:22 +0530 Subject: [PATCH 1/2] Added fix for issue #708 --- hpedockerplugin/volume_manager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hpedockerplugin/volume_manager.py b/hpedockerplugin/volume_manager.py index 32a5ca0f..727db438 100644 --- a/hpedockerplugin/volume_manager.py +++ b/hpedockerplugin/volume_manager.py @@ -1096,7 +1096,7 @@ def get_volume_snap_details(self, volname, snapname, qualified_name): self._set_qos_and_flash_cache_info(backend_vol_name, volinfo) qos_name = volinfo.get('qos_name') - if qos_name is not None: + if qos_name is not None and "ERROR" not in qos_name: try: qos_detail = self._hpeplugin_driver.get_qos_detail( qos_name) @@ -1108,6 +1108,8 @@ def get_volume_snap_details(self, volname, snapname, qualified_name): volume['Status'].update({'qos_detail': msg}) msg += ' %s' % six.text_type(ex) LOG.error(msg) + else: + volume['Status'].update({'qos_detail': qos_name}) flash_cache = volinfo.get('flash_cache') if flash_cache is not None: From 709ab13c471cb1157cc806aef42d490f8f96aaf8 Mon Sep 17 00:00:00 2001 From: bhagyashree-sarawate Date: Fri, 11 Oct 2019 06:54:37 -0400 Subject: [PATCH 2/2] Added fix as per the review comment --- hpedockerplugin/volume_manager.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/hpedockerplugin/volume_manager.py b/hpedockerplugin/volume_manager.py index a25bdc0c..3b01d953 100644 --- a/hpedockerplugin/volume_manager.py +++ b/hpedockerplugin/volume_manager.py @@ -1102,20 +1102,26 @@ def get_volume_snap_details(self, volname, snapname, qualified_name): self._set_qos_and_flash_cache_info(backend_vol_name, volinfo) qos_name = volinfo.get('qos_name') - if qos_name is not None and "ERROR" not in qos_name: + if qos_name is not None: try: - qos_detail = self._hpeplugin_driver.get_qos_detail( - qos_name) - qos_filter = self._get_required_qos_field(qos_detail) - volume['Status'].update({'qos_detail': qos_filter}) + vvset_detail = self._get_vvset_by_volume_name( + backend_vol_name) + if vvset_detail: + vvset_name = vvset_detail.get('name') + if vvset_name == qos_name: + qos_detail = self._hpeplugin_driver.get_qos_detail( + qos_name) + qos_filter = self._get_required_qos_field( + qos_detail) + volume['Status'].update({'qos_detail': qos_filter}) + else: + volume['Status'].update({'qos_detail': qos_name}) except Exception as ex: msg = "ERROR: Failed to retrieve QoS '%s' from 3PAR" \ % qos_name volume['Status'].update({'qos_detail': msg}) msg += ' %s' % six.text_type(ex) LOG.error(msg) - else: - volume['Status'].update({'qos_detail': qos_name}) flash_cache = volinfo.get('flash_cache') if flash_cache is not None: