diff options
author | Mohammed Junaid <junaid@redhat.com> | 2013-04-07 07:18:06 +0530 |
---|---|---|
committer | Peter Portante <peter.portante@redhat.com> | 2013-04-29 16:35:57 -0400 |
commit | 3a8c35fc2451bcef0e2dc6f651fc0bc1334bc753 (patch) | |
tree | 9991c5dc31094154ffa45d4776817ddb598bcaa7 | |
parent | 08b7da19a3e5c261776b8c2c5d9af08fb459c0d3 (diff) |
object-storage: cleanup err handling in Glusterfs.
Change-Id: I4fa1a7b9214c6897459a99bedde80e84eb2b9cbc
BUG: 904370
Signed-off-by: Mohammed Junaid <junaid@redhat.com>
Reviewed-on: http://review.gluster.org/4788
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r-- | ufo/gluster/swift/common/Glusterfs.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/ufo/gluster/swift/common/Glusterfs.py b/ufo/gluster/swift/common/Glusterfs.py index 1053610..a0c8126 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): |