]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
py3: Fix error handling in prophetstor driver
authorVictor Stinner <vstinner@redhat.com>
Sun, 8 Nov 2015 20:49:09 +0000 (21:49 +0100)
committerWalter A. Boring IV (hemna) <walter.boring@hpe.com>
Thu, 12 Nov 2015 23:54:28 +0000 (23:54 +0000)
* 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

cinder/volume/drivers/prophetstor/dplcommon.py
tests-py3.txt

index 8fa790ab6b4ede0241e2f8e2bcb145184315d827..8c5b3788c977905aa4695e1ef24cd2fec3c79526 100644 (file)
@@ -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,
index a1ab4b57c81de272c01c4d9c59ff0cf3fa37f268..268602b0be816d85b303dcc333e7c33a37edfa2c 100644 (file)
@@ -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