]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Ignore "volume does not exist error"
authorVictor Rodionov <vito.ordaz@gmail.com>
Thu, 1 Aug 2013 20:17:32 +0000 (00:17 +0400)
committerVictor Rodionov <vito.ordaz@gmail.com>
Thu, 1 Aug 2013 21:56:57 +0000 (01:56 +0400)
Patch to ignore "volume does not exist error" when driver is deleting volume.

Change-Id: I31645182e5495c44e67fe1add0a2e6c8222534b0

cinder/volume/drivers/nexenta/volume.py

index d181361860992c018abd9182cebd0fa8a97a87bd..ef5069777267cea157c402e4dbd3328d833d917f 100644 (file)
@@ -132,10 +132,13 @@ class NexentaDriver(driver.ISCSIDriver):  # pylint: disable=R0921
         try:
             self.nms.zvol.destroy(self._get_zvol_name(volume['name']), '')
         except nexenta.NexentaException as exc:
+            if "does not exist" in exc.args[1]:
+                LOG.info(_('Volume %s does not exist, it seems it was already '
+                           'deleted'), volume['name'])
+                return
             if "zvol has children" in exc.args[1]:
                 raise exception.VolumeIsBusy(volume_name=volume['name'])
-            else:
-                raise
+            raise
 
     def create_snapshot(self, snapshot):
         """Create snapshot of existing zvol on appliance.