]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
GlusterFS: Set correct permissions for volume file created via clone
authorEric Harney <eharney@redhat.com>
Mon, 25 Nov 2013 21:39:03 +0000 (16:39 -0500)
committerEric Harney <eharney@redhat.com>
Mon, 25 Nov 2013 22:41:58 +0000 (17:41 -0500)
This is currently done when creating a new volume from scratch,
but not when cloning a new volume.

Closes-Bug: #1254768
Change-Id: I8506dc0824bacdb6cc42b4cadd41c2cad3a74b5b

cinder/tests/test_glusterfs.py
cinder/volume/drivers/glusterfs.py

index 58822be0477c31a21a743f31517c90859f716671..bb3020e3ab8982ce808d7cf16b112df28b8871ac 100644 (file)
@@ -1443,6 +1443,7 @@ class GlusterFsDriverTestCase(test.TestCase):
         mox.StubOutWithMock(image_utils, 'convert_image')
         mox.StubOutWithMock(drv, '_read_info_file')
         mox.StubOutWithMock(image_utils, 'qemu_img_info')
+        mox.StubOutWithMock(drv, '_set_rw_permissions_for_all')
 
         dest_volume = self._simple_volume(
             'c1073000-0000-0000-0000-0000000c1073')
@@ -1484,6 +1485,8 @@ class GlusterFsDriverTestCase(test.TestCase):
 
         image_utils.convert_image(src_vol_path, dest_vol_path, 'raw')
 
+        drv._set_rw_permissions_for_all(dest_vol_path)
+
         mox.ReplayAll()
 
         drv._copy_volume_from_snapshot(snapshot, dest_volume, size)
index 7f7497c37ed03b96f8e9799f5a2fc2d72d31de4a..4f8f8f2ed693c344ad12167a92ac5189263fde1d 100644 (file)
@@ -265,6 +265,8 @@ class GlusterfsDriver(nfs.RemoteFsDriver):
                                   path_to_new_vol,
                                   out_format)
 
+        self._set_rw_permissions_for_all(path_to_new_vol)
+
     @utils.synchronized('glusterfs', external=False)
     def delete_volume(self, volume):
         """Deletes a logical volume."""