Hello Dan Kenigsberg, Milan Zamazal, I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/55534 to review the following change. Change subject: virt: clean and modernize the destroy() path ...................................................................... virt: clean and modernize the destroy() path cleanup the destroy path with no changes in behaviour. Change-Id: I46296fe7ac6c13e064014298148f518ea6b1e1d8 Bug-Url: https://bugzilla.redhat.com/1309884 Backport-To: 3.6 Signed-off-by: Francesco Romani <from...@redhat.com> Reviewed-on: https://gerrit.ovirt.org/53931 Continuous-Integration: Jenkins CI Reviewed-by: Milan Zamazal <mzama...@redhat.com> Reviewed-by: Dan Kenigsberg <dan...@redhat.com> --- M vdsm/virt/vm.py 1 file changed, 9 insertions(+), 7 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/34/55534/1 diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py index e942773..62da365 100644 --- a/vdsm/virt/vm.py +++ b/vdsm/virt/vm.py @@ -3852,21 +3852,23 @@ self.log.info("VM '%s' already down and destroyed", self.conf['vmId']) else: - self.log.warning("Failed to destroy VM '%s' gracefully", - self.conf['vmId'], exc_info=True) + self.log.warning( + "Failed to destroy VM '%s' gracefully (error=%i)", + self.id, e.get_error_code()) if e.get_error_code() == libvirt.VIR_ERR_OPERATION_FAILED: return self._destroyVmForceful() return response.error('destroyErr') - return {'status': doneCode} + return response.success() def _destroyVmForceful(self): try: self._dom.destroy() - except libvirt.libvirtError: - self.log.warning("Failed to destroy VM '%s'", - self.conf['vmId'], exc_info=True) + except libvirt.libvirtError as e: + self.log.warning( + "Failed to destroy VM '%s' forcefully (error=%i)", + self.id, e.get_error_code()) return response.error('destroyErr') - return {'status': doneCode} + return response.success() def deleteVm(self): """ -- To view, visit https://gerrit.ovirt.org/55534 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I46296fe7ac6c13e064014298148f518ea6b1e1d8 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.6 Gerrit-Owner: Francesco Romani <from...@redhat.com> Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com> Gerrit-Reviewer: Milan Zamazal <mzama...@redhat.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches