]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Adjust RBD delete log level
authorMike Perez <thingee@gmail.com>
Mon, 2 Dec 2013 21:42:52 +0000 (13:42 -0800)
committerMike Perez <thingee@gmail.com>
Tue, 3 Dec 2013 01:02:01 +0000 (17:02 -0800)
Set notice of volume no longer existing in RBD backend when attempting
to delete to log INFO level. Also move a comment next to related code.
This is a follow-up to suggestions from
3de7da12d1098ef777305099e5f4a039e536bf99.

Change-Id: I3ff854e0ead79e208106a371e14ec6ac7603d387

cinder/volume/drivers/rbd.py

index a6445d63a5eef71f28903bbdb57e3ff9b7ac081b..23cad16868d546d4555080b3ee890e925ca2d268 100644 (file)
@@ -587,13 +587,11 @@ class RBDDriver(driver.VolumeDriver):
         """Deletes a logical volume."""
         volume_name = str(volume['name'])
         with RADOSClient(self) as client:
-            # If the volume has non-clone snapshots this delete is expected to
-            # raise VolumeIsBusy so do so straight away.
             try:
                 rbd_image = self.rbd.Image(client.ioctx, volume_name)
             except self.rbd.ImageNotFound:
-                LOG.debug(_("volume %s no longer exists in backend")
-                          % (volume_name))
+                LOG.info(_("volume %s no longer exists in backend")
+                         % (volume_name))
                 return
 
             clone_snap = None
@@ -602,13 +600,15 @@ class RBDDriver(driver.VolumeDriver):
             # Ensure any backup snapshots are deleted
             self._delete_backup_snaps(client, volume_name)
 
+            # If the volume has non-clone snapshots this delete is expected to
+            # raise VolumeIsBusy so do so straight away.
             try:
                 snaps = rbd_image.list_snaps()
                 for snap in snaps:
                     if snap['name'].endswith('.clone_snap'):
                         LOG.debug(_("volume has clone snapshot(s)"))
                         # We grab one of these and use it when fetching parent
-                        # info in case the this volume has been flattened.
+                        # info in case the volume has been flattened.
                         clone_snap = snap['name']
                         break