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

danken at redhat.com danken at redhat.com
Fri Mar 25 13:15:38 UTC 2016


Dan Kenigsberg has submitted this change and it was merged.

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


virt: common handling of exceptions

Vm methods should not return responses directly.
Rather, they should raise proper exception,
and a common layer should translate them in responses.

In case of succesfull completion, this code automatically
produces a generic success response. Should the method
require extra fields, it can return a dictionary
with the keys to be added to the success response.

Using this way the method could also override the default
keys (e.g. the message). This is not clean but it could
be needed for backward compatibility.

Change-Id: Ic186dc8fa062d8b3789c6057bba68fbbc23f311b
Bug-Url: https://bugzilla.redhat.com/1316128
Signed-off-by: Francesco Romani <fromani at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/54664
Continuous-Integration: Jenkins CI
Reviewed-by: Nir Soffer <nsoffer at redhat.com>
---
M debian/vdsm-python.install
M lib/vdsm/virt/Makefile.am
A lib/vdsm/virt/api.py
M tests/Makefile.am
A tests/virt_api_test.py
M vdsm.spec.in
6 files changed, 173 insertions(+), 0 deletions(-)

Approvals:
  Nir Soffer: Looks good to me, approved
  Jenkins CI: Passed CI tests
  Francesco Romani: Verified



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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic186dc8fa062d8b3789c6057bba68fbbc23f311b
Gerrit-PatchSet: 15
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>


More information about the vdsm-patches mailing list