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:
Vipin Balachandran 2018-08-30 14:38:16 -07:00
parent 16cde62009
commit 258beef264
2 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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: