]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
GlusterFS: set correct filename when cloning volume
authorEric Harney <eharney@redhat.com>
Thu, 24 Oct 2013 20:18:54 +0000 (16:18 -0400)
committerEric Harney <eharney@redhat.com>
Thu, 24 Oct 2013 20:57:03 +0000 (16:57 -0400)
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

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

index 62276114a2950a16088af9aab32f8d4924e066bf..af4e1201e64e3ba485147603818b827dc6339cbc 100644 (file)
@@ -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,
index bd4293fbe9e03f9c0427a26b2638b58b1c18e766..0987be0373ebfaf7cc2c7647aa832c075d1bed72 100644 (file)
@@ -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'],