Merge "block_device: Rollback volumes to in-use on DeviceDetachFailed" into stable/pike
This commit is contained in:
commit
b612a63c36
|
@ -239,6 +239,8 @@ class TestDriverBlockDevice(test.NoDBTestCase):
|
|||
self.context, inst, vol_api, virt)
|
||||
self.assertFalse(log.exception.called)
|
||||
self.assertTrue(log.warning.called)
|
||||
vol_api.roll_detaching.assert_called_once_with(self.context,
|
||||
driver_bdm.volume_id)
|
||||
|
||||
def test_no_device_raises(self):
|
||||
for name, cls in self.driver_classes.items():
|
||||
|
|
|
@ -285,6 +285,7 @@ class DriverVolumeBlockDevice(DriverBlockDevice):
|
|||
with excutils.save_and_reraise_exception():
|
||||
LOG.warning('Guest refused to detach volume %(vol)s',
|
||||
{'vol': volume_id}, instance=instance)
|
||||
volume_api.roll_detaching(context, volume_id)
|
||||
except Exception:
|
||||
with excutils.save_and_reraise_exception():
|
||||
LOG.exception('Failed to detach volume '
|
||||
|
|
Loading…
Reference in New Issue