Francesco Romani has uploaded a new change for review. Change subject: vm: make _deleteVm() more robust ......................................................................
vm: make _deleteVm() more robust Use else: clause in a try: block to make deleteVm() more robust and a bit nicer. Change-Id: I870181ce2f261eed2e6b993c06f452619c28d042 Signed-off-by: Francesco Romani <from...@redhat.com> --- M vdsm/virt/vm.py 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/85/51385/1 diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py index b278b87..d79f07b 100644 --- a/vdsm/virt/vm.py +++ b/vdsm/virt/vm.py @@ -3884,10 +3884,11 @@ """ try: del self.cif.vmContainer[self.conf['vmId']] + except KeyError: + self.log.exception("Failed to delete VM %s", self.conf['vmId']) + else: self.log.debug("Total desktops after destroy of %s is %d", self.conf['vmId'], len(self.cif.vmContainer)) - except Exception: - self.log.exception("Failed to delete VM %s", self.conf['vmId']) def destroy(self): self.log.debug('destroy Called') -- To view, visit https://gerrit.ovirt.org/51385 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I870181ce2f261eed2e6b993c06f452619c28d042 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani <from...@redhat.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches