Skip to content

Commit

Permalink
GlusterFS: Set correct permissions for volume file created via clone
Browse files Browse the repository at this point in the history
This is currently done when creating a new volume from scratch,
but not when cloning a new volume.

Closes-Bug: #1254768
Change-Id: I8506dc0824bacdb6cc42b4cadd41c2cad3a74b5b
  • Loading branch information
eharney committed Nov 25, 2013
1 parent 0b71a3f commit 9c816aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cinder/tests/test_glusterfs.py
Expand Up @@ -1443,6 +1443,7 @@ def test_copy_volume_from_snapshot(self):
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')
Expand Down Expand Up @@ -1484,6 +1485,8 @@ def test_copy_volume_from_snapshot(self):

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)
Expand Down
2 changes: 2 additions & 0 deletions cinder/volume/drivers/glusterfs.py
Expand Up @@ -265,6 +265,8 @@ def _copy_volume_from_snapshot(self, snapshot, volume, volume_size):
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."""
Expand Down

0 comments on commit 9c816aa

Please sign in to comment.