From bf7b83d2bcc490a9a70ddd0fcf71e8a81c5430a2 Mon Sep 17 00:00:00 2001 From: Mohammed Junaid Date: Sun, 7 Apr 2013 07:18:06 +0530 Subject: object-storage: cleanup err handling in Glusterfs. Change-Id: I4fa1a7b9214c6897459a99bedde80e84eb2b9cbc BUG: 904370 Signed-off-by: Mohammed Junaid Reviewed-on: http://review.gluster.org/4788 Reviewed-by: Kaleb KEITHLEY Tested-by: Gluster Build System Reviewed-by: Anand Avati --- ufo/gluster/swift/common/Glusterfs.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ufo/gluster/swift/common/Glusterfs.py b/ufo/gluster/swift/common/Glusterfs.py index 1053610b3..a0c81269c 100644 --- a/ufo/gluster/swift/common/Glusterfs.py +++ b/ufo/gluster/swift/common/Glusterfs.py @@ -86,14 +86,13 @@ def mount(root, drive): with os.fdopen(fd, 'r+b') as f: try: fcntl.lockf(f, fcntl.LOCK_EX|fcntl.LOCK_NB) - except: - ex = sys.exc_info()[1] - if isinstance(ex, IOError) and ex.errno in \ - (errno.EACCES, errno.EAGAIN): + except IOError as ex: + if ex.errno in (errno.EACCES, errno.EAGAIN): # This means that some other process is mounting the # filesystem, so wait for the mount process to complete return _busy_wait(full_mount_path) - + else: + raise ex mnt_cmd = 'mount -t glusterfs %s:%s %s' % (MOUNT_IP, export, \ full_mount_path) if os.system(mnt_cmd) or not _busy_wait(full_mount_path): -- cgit