Add support for OS-Brick force disconnect
OS-Brick disconnect has a force parameter since version 1.15.1 that can be used to make sure a disconnect call gives more priority to cleaning up everything than preserving data. This patch adds support for this new force parameter using it in calls where we know it's OK to lose data when we encounter an error as long as we report that we have failed. Change-Id: Id6a7f4cf264c540473269104daf20f39891b5a1b
This commit is contained in:
@@ -623,7 +623,9 @@ class BackupTestCase(BaseBackupTest):
|
||||
mock_get_backup_device.assert_called_once_with(self.ctxt, backup, vol)
|
||||
mock_get_conn.assert_called_once_with()
|
||||
mock_detach_device.assert_called_once_with(self.ctxt, attach_info,
|
||||
vol, properties, False)
|
||||
vol, properties, False,
|
||||
force=True,
|
||||
ignore_errors=True)
|
||||
|
||||
vol = objects.Volume.get_by_id(self.ctxt, vol_id)
|
||||
self.assertEqual('available', vol['status'])
|
||||
@@ -738,7 +740,7 @@ class BackupTestCase(BaseBackupTest):
|
||||
mock_get_backup_device.assert_called_once_with(self.ctxt, backup, vol)
|
||||
mock_get_conn.assert_called_once_with()
|
||||
mock_terminate_connection_snapshot.assert_called_once_with(
|
||||
self.ctxt, snap, properties, force=False)
|
||||
self.ctxt, snap, properties, force=True)
|
||||
vol = objects.Volume.get_by_id(self.ctxt, vol_id)
|
||||
self.assertEqual('in-use', vol['status'])
|
||||
self.assertEqual('backing-up', vol['previous_status'])
|
||||
@@ -927,7 +929,7 @@ class BackupTestCase(BaseBackupTest):
|
||||
mock_attach_device.assert_called_once_with(self.ctxt, vol,
|
||||
properties)
|
||||
mock_detach_device.assert_called_once_with(self.ctxt, attach_info,
|
||||
vol, properties)
|
||||
vol, properties, force=True)
|
||||
|
||||
vol = objects.Volume.get_by_id(self.ctxt, vol_id)
|
||||
self.assertEqual('available', vol['status'])
|
||||
|
||||
Reference in New Issue
Block a user