]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Do not remove volume silently if GPFS is unmounted
authorzhaoqin <chaochin@gmail.com>
Fri, 8 Nov 2013 18:27:49 +0000 (02:27 +0800)
committerzhaoqin <chaochin@gmail.com>
Fri, 8 Nov 2013 18:29:13 +0000 (02:29 +0800)
When GPFS is not mounted, delete_volume() will complete successfully, so that
volume record is removed by cinder but volume file still resides on GPFS. This
change will prevent cinder to remove volume when GPFS is not mounted.

Change-Id: Ic3bf265e553f22c8b6a6e3568da04af88fab3322
Closes-Bug: #1249411

cinder/volume/drivers/gpfs.py

index 2e5b8119cbbcf531437a2f4802c3be00cc6500d4..55d573e8eb0e786e82a6e214652328b89306ee40 100644 (file)
@@ -330,6 +330,9 @@ class GPFSDriver(driver.VolumeDriver):
 
     def delete_volume(self, volume):
         """Deletes a logical volume."""
+        # Check if GPFS is mounted
+        self._verify_gpfs_path_state(self.configuration.gpfs_mount_point_base)
+
         volume_path = self.local_path(volume)
         self._delete_gpfs_file(volume_path)