Merge "VMware: Fix revert-to-snapshot"
This commit is contained in:
commit
8bd4ff7e6a
@ -3240,7 +3240,7 @@ class VMwareVcVmdkDriverTestCase(test.TestCase):
|
|||||||
self._driver.revert_to_snapshot(
|
self._driver.revert_to_snapshot(
|
||||||
mock.sentinel.context, volume, snapshot)
|
mock.sentinel.context, volume, snapshot)
|
||||||
|
|
||||||
vops.get_backing.assert_called_once_with(volume.name)
|
vops.get_backing.assert_called_once_with(volume.name, volume.id)
|
||||||
vops.revert_to_snapshot.assert_not_called()
|
vops.revert_to_snapshot.assert_not_called()
|
||||||
|
|
||||||
@mock.patch.object(VMDK_DRIVER, 'volumeops')
|
@mock.patch.object(VMDK_DRIVER, 'volumeops')
|
||||||
@ -3268,7 +3268,7 @@ class VMwareVcVmdkDriverTestCase(test.TestCase):
|
|||||||
self._driver.revert_to_snapshot(
|
self._driver.revert_to_snapshot(
|
||||||
mock.sentinel.context, volume, snapshot)
|
mock.sentinel.context, volume, snapshot)
|
||||||
|
|
||||||
vops.get_backing.assert_called_once_with(volume.name)
|
vops.get_backing.assert_called_once_with(volume.name, volume.id)
|
||||||
vops.revert_to_snapshot.assert_called_once_with(backing,
|
vops.revert_to_snapshot.assert_called_once_with(backing,
|
||||||
snapshot.name)
|
snapshot.name)
|
||||||
|
|
||||||
|
@ -2218,7 +2218,7 @@ class VMwareVcVmdkDriver(driver.VolumeDriver):
|
|||||||
raise exception.InvalidSnapshot("Cannot revert to template "
|
raise exception.InvalidSnapshot("Cannot revert to template "
|
||||||
"based snapshot")
|
"based snapshot")
|
||||||
|
|
||||||
backing = self.volumeops.get_backing(volume.name)
|
backing = self.volumeops.get_backing(volume.name, volume.id)
|
||||||
if not backing:
|
if not backing:
|
||||||
LOG.debug("Backing does not exist for volume.", resource=volume)
|
LOG.debug("Backing does not exist for volume.", resource=volume)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user