py3: Fix error handling in prophetstor driver
* Port prophetstor driver to Python 3 * Replace "except exception as e:" with "except Exception as e:" to handle "Fexvisor failed to join the volume ..." and "Fexvisor failed to remove the volume ..." errors. Here, lower case "exception" is the cinder.exception module, not an exception class. On Python 3, "except" requires exception classes. * tests-py3.txt: add cinder.tests.unit.test_prophetstor_dpl Partial-Implements: blueprint cinder-python3 Change-Id: I0447b62cc0afe5a10ecbc888dfb6608b69f977d2
This commit is contained in:
parent
94f21f8020
commit
2ff3f0be12
@ -993,7 +993,7 @@ class DPLCOMMONDriver(driver.ConsistencyGroupVD, driver.ExtendVD,
|
||||
if self._conver_uuid2hex(vid) in group_members:
|
||||
continue
|
||||
self._join_volume_group(volume, cgid)
|
||||
except exception as e:
|
||||
except Exception as e:
|
||||
msg = _("Fexvisor failed to join the volume %(vol)s in the "
|
||||
"group %(group)s due to "
|
||||
"%(ret)s.") % {"vol": vid, "group": cgid,
|
||||
@ -1005,7 +1005,7 @@ class DPLCOMMONDriver(driver.ConsistencyGroupVD, driver.ExtendVD,
|
||||
vid = volume['id']
|
||||
if self._conver_uuid2hex(vid) in group_members:
|
||||
self._leave_volume_group(volume, cgid)
|
||||
except exception as e:
|
||||
except Exception as e:
|
||||
msg = _("Fexvisor failed to remove the volume %(vol)s in the "
|
||||
"group %(group)s due to "
|
||||
"%(ret)s.") % {"vol": vid, "group": cgid,
|
||||
|
@ -86,6 +86,7 @@ cinder.tests.unit.test_netapp_nfs
|
||||
cinder.tests.unit.test_netapp_ssc
|
||||
cinder.tests.unit.test_nfs
|
||||
cinder.tests.unit.test_nimble
|
||||
cinder.tests.unit.test_prophetstor_dpl
|
||||
cinder.tests.unit.test_pure
|
||||
cinder.tests.unit.test_qos_specs
|
||||
cinder.tests.unit.test_quobyte
|
||||
|
Loading…
x
Reference in New Issue
Block a user