From: chaochin Date: Mon, 21 Oct 2013 10:36:32 +0000 (-0500) Subject: Let GPFS driver to rename snapshot with root permission X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=1212f66b188bbe40ac7219908eb47af26ebf2edc;p=openstack-build%2Fcinder-build.git Let GPFS driver to rename snapshot with root permission Deleting GPFS volume snapshot operation fails, because cinder volume is not running with root permission. Change-Id: Id00357030da171fddbc6abf82603ceabe4db73ff Closes-Bug: #1242549 --- diff --git a/cinder/volume/drivers/gpfs.py b/cinder/volume/drivers/gpfs.py index f7f3ddd8e..a2b01c387 100644 --- a/cinder/volume/drivers/gpfs.py +++ b/cinder/volume/drivers/gpfs.py @@ -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)