Merge "Add cluster_name to temporary volumes"

This commit is contained in:
Jenkins 2017-02-01 07:44:23 +00:00 committed by Gerrit Code Review
commit c4ea8f598d
2 changed files with 6 additions and 3 deletions

View File

@ -6860,6 +6860,7 @@ class GenericVolumeDriverTestCase(DriverTestCase):
def test__create_temp_volume_from_snapshot(self):
volume_dict = {'id': fake.SNAPSHOT_ID,
'host': 'fakehost',
'cluster_name': 'fakecluster',
'availability_zone': 'fakezone',
'size': 1}
vol = fake_volume.fake_volume_obj(self.context, **volume_dict)
@ -6874,6 +6875,7 @@ class GenericVolumeDriverTestCase(DriverTestCase):
self.assertEqual(fields.VolumeAttachStatus.DETACHED,
temp_vol.attach_status)
self.assertEqual('fakezone', temp_vol.availability_zone)
self.assertEqual('fakecluster', temp_vol.cluster_name)
@mock.patch.object(utils, 'brick_get_connector_properties')
@mock.patch.object(cinder.volume.manager.VolumeManager, '_attach_volume')

View File

@ -1424,9 +1424,10 @@ class BaseVD(object):
def _create_temp_volume(self, context, volume):
kwargs = {
'size': volume['size'],
'display_name': 'backup-vol-%s' % volume['id'],
'host': volume['host'],
'size': volume.size,
'display_name': 'backup-vol-%s' % volume.id,
'host': volume.host,
'cluster_name': volume.cluster_name,
'user_id': context.user_id,
'project_id': context.project_id,
'status': 'creating',