diff options
author | Mohammed Junaid <junaid@redhat.com> | 2013-04-07 07:18:06 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-04-12 13:49:13 -0700 |
commit | bf7b83d2bcc490a9a70ddd0fcf71e8a81c5430a2 (patch) | |
tree | dc7ee00ad315db5f47802ee1203e43f8c946582b | |
parent | bbaa273468f8e5377027aedcabcaa076dd7fec7e (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 1053610b386..a0c81269cdc 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): |