Change in vdsm[master]: gluster: handle an unhandled exception in gfapi.py

dnarayan at redhat.com dnarayan at redhat.com
Wed Jul 15 11:58:12 UTC 2015


Darshan N has uploaded a new change for review.

Change subject: gluster: handle an unhandled exception in gfapi.py
......................................................................

gluster: handle an unhandled exception in gfapi.py

This patch handles an un handled exception in gfapi.py
which is related to gluster libgfapi. This exception was
seen when glusterVolumsStatsInfo and glusterVolumeStatus
verbs were invoked. Now this has been handled properly.

Change-Id: I222345801e8d33ef17f0ae5ca66b1d34fa80d95b
Signed-off-by: Darshan N <dnarayan at redhat.com>
---
M vdsm/gluster/gfapi.py
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/70/43670/1

diff --git a/vdsm/gluster/gfapi.py b/vdsm/gluster/gfapi.py
index ef0e863..e5105fc 100644
--- a/vdsm/gluster/gfapi.py
+++ b/vdsm/gluster/gfapi.py
@@ -285,8 +285,12 @@
 if __name__ == '__main__':
     args = parse_cmdargs()
     if args.command.upper() == 'STATVFS':
-        res = volumeStatvfsGet(args.volume, args.host,
-                               int(args.port), args.protocol)
+        try:
+            res = volumeStatvfsGet(args.volume, args.host,
+                                   int(args.port), args.protocol)
+        except ge.GlusterException as e:
+            sys.stderr.write(str(e))
+            sys.exit(1)
         json.dump({'f_blocks': res.f_blocks, 'f_bfree': res.f_bfree,
                    'f_bsize': res.f_bsize, 'f_frsize': res.f_frsize,
                    'f_bavail': res.f_bavail, 'f_files': res.f_files,


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I222345801e8d33ef17f0ae5ca66b1d34fa80d95b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Darshan N <dnarayan at redhat.com>


More information about the vdsm-patches mailing list