Hello Dan Kenigsberg,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/55533
to review the following change.
Change subject: vm: use response module in the destroy path
......................................................................
vm: use response module in the destroy path
use the facilities of the response module to
make the code nicer, and easier to change in the future.
Change-Id: I92402f2101c4c256e18b251e2e12e65b8ae849a1
Backport-To: 3.6
Signed-off-by: Francesco Romani <[email protected]>
Reviewed-on: https://gerrit.ovirt.org/51383
Continuous-Integration: Jenkins CI
Reviewed-by: Dan Kenigsberg <[email protected]>
---
M vdsm/virt/vm.py
1 file changed, 5 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/33/55533/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 890d328..e942773 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -3801,7 +3801,7 @@
with self._releaseLock:
if self._released:
- return {'status': doneCode}
+ return response.success()
# unsetting mirror network will clear both mirroring
# (on the same network).
@@ -3819,7 +3819,7 @@
self.guestAgent.stop()
if self._dom.connected:
result = self._destroyVmGraceful()
- if result['status']['code']:
+ if response.is_error(result):
return result
# Wait for any Live Merge cleanup threads. This will only block in
@@ -3840,7 +3840,7 @@
self._released = True
- return {'status': doneCode}
+ return response.success()
def _destroyVmGraceful(self):
try:
@@ -3885,12 +3885,12 @@
self.log.debug('destroy Called')
result = self.doDestroy()
- if result['status']['code']:
+ if response.is_error(result):
return result
# Clean VM from the system
self.deleteVm()
- return {'status': doneCode}
+ return response.success()
def doDestroy(self):
for dev in self._customDevices():
--
To view, visit https://gerrit.ovirt.org/55533
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I92402f2101c4c256e18b251e2e12e65b8ae849a1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Francesco Romani <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches