]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Nexenta iSCSI driver fix _lu_exists
authorVictor Rodionov <vito.ordaz@gmail.com>
Mon, 7 Oct 2013 23:19:23 +0000 (03:19 +0400)
committerVictor Rodionov <vito.ordaz@gmail.com>
Mon, 7 Oct 2013 23:19:23 +0000 (03:19 +0400)
Catch "does not exist" exception of NMS scsidisk lu_exists method.

Change-Id: I082b588dfbf54efec68a9affc76466097765b6db
Closes-Bug: #1236626

cinder/volume/drivers/nexenta/volume.py

index 219df2647689000b7da3b5dc40e7a30938e9c707..edcb6327274e6302a1c9f0dcd6822e4fd67c15a3 100644 (file)
@@ -43,9 +43,15 @@ CONF.register_opts(options.NEXENTA_VOLUME_OPTIONS)
 
 
 class NexentaDriver(driver.ISCSIDriver):  # pylint: disable=R0921
-    """Executes volume driver commands on Nexenta Appliance."""
+    """Executes volume driver commands on Nexenta Appliance.
 
-    VERSION = '1.0.0'
+    Version history:
+        1.0.0 - Initial driver version.
+        1.0.1 - Fixed bug #1236626: catch "does not exist" exception of
+                lu_exists.
+    """
+
+    VERSION = '1.0.1'
 
     def __init__(self, *args, **kwargs):
         super(NexentaDriver, self).__init__(*args, **kwargs)
@@ -264,7 +270,12 @@ class NexentaDriver(driver.ISCSIDriver):  # pylint: disable=R0921
         :raises: NexentaException if zvol not exists
         :return: True if LU exists, else False
         """
-        return bool(self.nms.scsidisk.lu_exists(zvol_name))
+        try:
+            return bool(self.nms.scsidisk.lu_exists(zvol_name))
+        except nexenta.NexentaException as exc:
+            if 'does not exist' not in exc.args[0]:
+                raise
+            return False
 
     def _is_lu_shared(self, zvol_name):
         """Check if LU exists on appliance and shared.