Change in vdsm[ovirt-3.5]: gluster: Handle gluster exceptions in json rpc mode.

dnarayan at redhat.com dnarayan at redhat.com
Mon Apr 13 05:35:08 UTC 2015


Hello Piotr Kliczewski, Bala.FA, Dan Kenigsberg,

I'd like you to do a code review.  Please visit

    https://gerrit.ovirt.org/39788

to review the following change.

Change subject: gluster: Handle gluster exceptions in json rpc mode.
......................................................................

gluster: Handle gluster exceptions in json rpc mode.

This patch adds code to handle gluster exceptions in
JSON rpc mode. Earlier gluster exceptions were not
propagated properly in json rpc mode.

Change-Id: I3215a716369bac8d31a5d208b13f1dd73bd3bf7c
Bug-Url: https://bugzilla.redhat.com/1207150
Signed-off-by: Darshan N <dnarayan at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/39573
Reviewed-by: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Reviewed-by: Bala.FA <barumuga at redhat.com>
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M vdsm/rpc/Bridge.py
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/88/39788/1

diff --git a/vdsm/rpc/Bridge.py b/vdsm/rpc/Bridge.py
index c964741..746df7c 100644
--- a/vdsm/rpc/Bridge.py
+++ b/vdsm/rpc/Bridge.py
@@ -27,6 +27,7 @@
 
 try:
     import gluster.apiwrapper as gapi
+    import gluster.exception as ge
     _glusterEnabled = True
 except ImportError:
     _glusterEnabled = False
@@ -261,7 +262,13 @@
         else:
             fn = getattr(api, methodName)
             try:
-                result = fn(*methodArgs)
+                if _glusterEnabled:
+                    try:
+                        result = fn(*methodArgs)
+                    except ge.GlusterException as e:
+                        result = e.response()
+                else:
+                        result = fn(*methodArgs)
             except TypeError as e:
                 raise InvalidCall(fn, methodArgs, e)
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3215a716369bac8d31a5d208b13f1dd73bd3bf7c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Darshan N <dnarayan at redhat.com>
Gerrit-Reviewer: Bala.FA <barumuga at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>


More information about the vdsm-patches mailing list