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 <[email protected]>
Reviewed-on: https://gerrit.ovirt.org/39573
Reviewed-by: Piotr Kliczewski <[email protected]>
Reviewed-by: Bala.FA <[email protected]>
Reviewed-by: Dan Kenigsberg <[email protected]>
---
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 <[email protected]>
Gerrit-Reviewer: Bala.FA <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Piotr Kliczewski <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to