Change in vdsm[master]: virt: common handling of exceptions

nsoffer at redhat.com nsoffer at redhat.com
Wed Mar 16 14:36:39 UTC 2016


Nir Soffer has posted comments on this change.

Change subject: virt: common handling of exceptions
......................................................................


Patch Set 7:

(1 comment)

https://gerrit.ovirt.org/#/c/54664/7/lib/vdsm/virt/api.py
File lib/vdsm/virt/api.py:

Line 45: 
Line 46:         _log.debug("FINISH %s response=%s", func.__name__, ret)
Line 47: 
Line 48:         if isinstance(ret, dict):
Line 49:             return response.success(**ret)
> maybe add a debug log to document that the return value is discarded?
I just noticed this, we should not do this.

We should have a clear and strict api:
- if there is not return value, return None (e.g. no return in python)
- If there is a return value it must be a dict

The code should be:

    if ret is None:
        return response.success()
    else:
        return response.success(**ret)

Hopefully this works with current vdsm verbs.
Line 50:         return response.success()
Line 51: 


-- 
To view, visit https://gerrit.ovirt.org/54664
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic186dc8fa062d8b3789c6057bba68fbbc23f311b
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Amit Aviram <aaviram at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list