Skip to content

Commit

Permalink
GlusterFS: set correct filename when cloning volume
Browse files Browse the repository at this point in the history
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
  • Loading branch information
eharney committed Oct 24, 2013
1 parent 91d388b commit bfb6601
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cinder/tests/test_glusterfs.py
Expand Up @@ -601,7 +601,7 @@ def test_create_cloned_volume(self):
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']}
Expand Down Expand Up @@ -1509,7 +1509,7 @@ def test_create_volume_from_snapshot(self):
'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,
Expand Down
4 changes: 2 additions & 2 deletions cinder/volume/drivers/glusterfs.py
Expand Up @@ -162,12 +162,12 @@ def create_cloned_volume(self, volume, src_vref):
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'],
Expand Down

0 comments on commit bfb6601

Please sign in to comment.