Merge "Fix UnBoundLocalError in update_consistencygroup"
This commit is contained in:
commit
9450384328
@ -203,6 +203,23 @@ class ConsistencyGroupTestCase(base.BaseVolumeTestCase):
|
||||
self.volume.db.volume_get.reset_mock()
|
||||
self.volume.db.volume_get = volume_get_orig
|
||||
|
||||
def test_update_consistencygroup_volume_not_found(self):
|
||||
group = tests_utils.create_consistencygroup(
|
||||
self.context,
|
||||
availability_zone=CONF.storage_availability_zone,
|
||||
volume_type='type1,type2')
|
||||
self.assertRaises(exception.VolumeNotFound,
|
||||
self.volume.update_consistencygroup,
|
||||
self.context,
|
||||
group,
|
||||
fake.VOLUME_ID)
|
||||
self.assertRaises(exception.VolumeNotFound,
|
||||
self.volume.update_consistencygroup,
|
||||
self.context,
|
||||
group,
|
||||
None,
|
||||
fake.VOLUME_ID)
|
||||
|
||||
@mock.patch.object(driver.VolumeDriver,
|
||||
"create_consistencygroup",
|
||||
return_value={'status': 'available'})
|
||||
|
@ -3199,7 +3199,7 @@ class VolumeManager(manager.CleanableManager,
|
||||
LOG.error(_LE("Update consistency group "
|
||||
"failed to add volume-%(volume_id)s: "
|
||||
"VolumeNotFound."),
|
||||
{'volume_id': add_vol_ref['id']},
|
||||
{'volume_id': add_vol},
|
||||
resource={'type': 'consistency_group',
|
||||
'id': group.id})
|
||||
raise
|
||||
@ -3228,7 +3228,7 @@ class VolumeManager(manager.CleanableManager,
|
||||
LOG.error(_LE("Update consistency group "
|
||||
"failed to remove volume-%(volume_id)s: "
|
||||
"VolumeNotFound."),
|
||||
{'volume_id': remove_vol_ref['id']},
|
||||
{'volume_id': remove_vol},
|
||||
resource={'type': 'consistency_group',
|
||||
'id': group.id})
|
||||
raise
|
||||
|
Loading…
x
Reference in New Issue
Block a user