Merge "Don't unmount device twice"
This commit is contained in:
commit
671bbf2134
@ -185,12 +185,11 @@ class CinderVolumeDriverTestCase(base.TestCase):
|
||||
self.assertEqual(self.fake_container_path, destination)
|
||||
mock_get_mountpoint.assert_called_once_with(self.fake_uuid)
|
||||
|
||||
@mock.patch('shutil.rmtree')
|
||||
@mock.patch('zun.common.mount.get_mountpoint')
|
||||
@mock.patch('zun.common.mount.Mounter.read_mounts')
|
||||
@mock.patch('zun.volume.cinder_workflow.CinderWorkflow')
|
||||
def test_delete(self, mock_cinder_workflow_cls, mock_read_mounts,
|
||||
mock_get_mountpoint, mock_rmtree):
|
||||
mock_get_mountpoint):
|
||||
mock_cinder_workflow = mock.MagicMock()
|
||||
mock_cinder_workflow_cls.return_value = mock_cinder_workflow
|
||||
mock_cinder_workflow.delete_volume.return_value = self.fake_volume_id
|
||||
@ -200,7 +199,6 @@ class CinderVolumeDriverTestCase(base.TestCase):
|
||||
volume_driver.delete(self.context, self.volume)
|
||||
|
||||
mock_cinder_workflow.delete_volume.assert_called_once_with(self.volume)
|
||||
mock_rmtree.assert_called_once_with(self.fake_mountpoint)
|
||||
|
||||
|
||||
class LocalVolumeDriverTestCase(base.TestCase):
|
||||
|
@ -159,7 +159,6 @@ class Cinder(VolumeDriver):
|
||||
|
||||
@validate_volume_provider(supported_providers)
|
||||
def delete(self, context, volume):
|
||||
self._unmount_device(volume)
|
||||
cinder = cinder_workflow.CinderWorkflow(context)
|
||||
cinder.delete_volume(volume)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user