]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Let GPFS driver to rename snapshot with root permission
authorchaochin <chaochin@zhaoqin-RHEL-GPFS1.(none)>
Mon, 21 Oct 2013 10:36:32 +0000 (05:36 -0500)
committerzhaoqin <zhaoqin@cn.ibm.com>
Mon, 21 Oct 2013 10:46:16 +0000 (05:46 -0500)
Deleting GPFS volume snapshot operation fails, because cinder
volume is not running with root permission.

Change-Id: Id00357030da171fddbc6abf82603ceabe4db73ff
Closes-Bug: #1242549

cinder/volume/drivers/gpfs.py

index f7f3ddd8ec1bcefca7b8d949ccd8df561e3d0ee2..a2b01c3871fa95d6fe17d3c2f2659203adf4dfcc 100644 (file)
@@ -397,7 +397,7 @@ class GPFSDriver(driver.VolumeDriver):
         # snapshots will also be deleted.
         snapshot_path = self.local_path(snapshot)
         snapshot_ts_path = '%s.ts' % snapshot_path
-        os.rename(snapshot_path, snapshot_ts_path)
+        self._execute('mv', snapshot_path, snapshot_ts_path, run_as_root=True)
         self._execute('rm', '-f', snapshot_ts_path,
                       check_exit_code=False, run_as_root=True)