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
This commit is contained in:
Eric Harney 2013-10-24 16:18:54 -04:00
parent 91d388b384
commit bfb66019ed
2 changed files with 4 additions and 4 deletions

View 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,

View 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'],