From: Eric Harney Date: Thu, 24 Oct 2013 20:18:54 +0000 (-0400) Subject: GlusterFS: set correct filename when cloning volume X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=bfb66019edd197141ea1462ba78dd27a2ed0e40d;p=openstack-build%2Fcinder-build.git GlusterFS: set correct filename when cloning volume When cloning a volume, the volume[name] field was populated with incorrect data, resulting in an unexpected filename containing the volume data. This results in failures of later operations on that cloned volume. Change-Id: I067ed44cebdc8e91e9ded326953fd0c99d003f05 Closes-Bug: #1244238 --- diff --git a/cinder/tests/test_glusterfs.py b/cinder/tests/test_glusterfs.py index 62276114a..af4e1201e 100644 --- a/cinder/tests/test_glusterfs.py +++ b/cinder/tests/test_glusterfs.py @@ -601,7 +601,7 @@ class GlusterFsDriverTestCase(test.TestCase): volume_file) src_info_path = '%s.info' % volume_path volume_ref = {'id': volume['id'], - 'name': volume['name'] + '-clone', + 'name': volume['name'], 'status': volume['status'], 'provider_location': volume['provider_location'], 'size': volume['size']} @@ -1509,7 +1509,7 @@ class GlusterFsDriverTestCase(test.TestCase): 'size': volume['size'], 'status': volume['status'], 'provider_location': volume['provider_location'], - 'name': 'volume-' + volume['id'] + '-clone'} + 'name': 'volume-' + volume['id']} drv.create_snapshot(snap_ref) drv._copy_volume_from_snapshot(snap_ref, diff --git a/cinder/volume/drivers/glusterfs.py b/cinder/volume/drivers/glusterfs.py index bd4293fbe..0987be037 100644 --- a/cinder/volume/drivers/glusterfs.py +++ b/cinder/volume/drivers/glusterfs.py @@ -162,12 +162,12 @@ class GlusterfsDriver(nfs.RemoteFsDriver): msg = _("Volume status must be 'available'.") raise exception.InvalidVolume(msg) - volume_name = CONF.volume_name_template % src_vref['id'] + volume_name = CONF.volume_name_template % volume['id'] volume_info = {'provider_location': src_vref['provider_location'], 'size': src_vref['size'], 'id': volume['id'], - 'name': '%s-clone' % volume_name, + 'name': volume_name, 'status': src_vref['status']} temp_snapshot = {'volume_name': volume_name, 'size': src_vref['size'],