VMware: Fix revert-to-snapshot
Commit 46b8da35d7
modified
the method we use to query the backend volumes. But,
revert-to-snapshot implementation which was in-progress
when the above commit was merged missed that change.
Fixing it by updating the query method call in
revert_to_snapshot.
Change-Id: I34cbd4420b43f52cd8d23833658f6386cb3e6437
Closes-bug: #1790008
This commit is contained in:
parent
16cde62009
commit
258beef264
@ -3232,7 +3232,7 @@ class VMwareVcVmdkDriverTestCase(test.TestCase):
|
||||
self._driver.revert_to_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()
|
||||
|
||||
@mock.patch.object(VMDK_DRIVER, 'volumeops')
|
||||
@ -3260,7 +3260,7 @@ class VMwareVcVmdkDriverTestCase(test.TestCase):
|
||||
self._driver.revert_to_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,
|
||||
snapshot.name)
|
||||
|
||||
|
@ -2226,7 +2226,7 @@ class VMwareVcVmdkDriver(driver.VolumeDriver):
|
||||
raise exception.InvalidSnapshot("Cannot revert to template "
|
||||
"based snapshot")
|
||||
|
||||
backing = self.volumeops.get_backing(volume.name)
|
||||
backing = self.volumeops.get_backing(volume.name, volume.id)
|
||||
if not backing:
|
||||
LOG.debug("Backing does not exist for volume.", resource=volume)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user