Merge "RBD: Make snapshot_delete more robust"
This commit is contained in:
commit
087c093a2e
@ -371,6 +371,19 @@ class RBDTestCase(test.TestCase):
|
||||
proxy.remove_snap.assert_called_with(self.snapshot_name)
|
||||
proxy.unprotect_snap.assert_called_with(self.snapshot_name)
|
||||
|
||||
@common_mocks
|
||||
def test_delete_notfound_snapshot(self):
|
||||
proxy = self.mock_proxy.return_value
|
||||
proxy.__enter__.return_value = proxy
|
||||
|
||||
proxy.unprotect_snap.side_effect = (
|
||||
self.mock_rbd.ImageNotFound)
|
||||
|
||||
self.driver.delete_snapshot(self.snapshot)
|
||||
|
||||
proxy.remove_snap.assert_called_with(self.snapshot_name)
|
||||
proxy.unprotect_snap.assert_called_with(self.snapshot_name)
|
||||
|
||||
@common_mocks
|
||||
def test_delete_busy_snapshot(self):
|
||||
proxy = self.mock_proxy.return_value
|
||||
|
@ -749,6 +749,9 @@ class RBDDriver(driver.TransferVD, driver.ExtendVD,
|
||||
with RBDVolumeProxy(self, volume_name) as volume:
|
||||
try:
|
||||
volume.unprotect_snap(snap_name)
|
||||
except self.rbd.ImageNotFound:
|
||||
LOG.info(_LI("Snapshot %s does not exist in backend."),
|
||||
snap_name)
|
||||
except self.rbd.ImageBusy:
|
||||
children_list = self._get_children_info(volume, snap_name)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user