From 5fc5ba9ccbb5786bc2e4d11e47c0b92f1cf56a42 Mon Sep 17 00:00:00 2001 From: zhaoqin Date: Sat, 9 Nov 2013 02:27:49 +0800 Subject: [PATCH] Do not remove volume silently if GPFS is unmounted 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cinder/volume/drivers/gpfs.py b/cinder/volume/drivers/gpfs.py index 2e5b8119c..55d573e8e 100644 --- a/cinder/volume/drivers/gpfs.py +++ b/cinder/volume/drivers/gpfs.py @@ -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) -- 2.45.2