From 9d520a05baf91cdbed17e31a15dcbce0d35191d0 Mon Sep 17 00:00:00 2001 From: Mohammed Junaid Date: Wed, 3 Apr 2013 05:40:17 +0530 Subject: object-storage: Import missing sys and errno modules. Import the missing modules and implemented unit test case for Glusterfs module. Thanks to Paul Smith for pointing it out. Change-Id: Ib04202aa0ae05c4da2ebbf11f87d6accc778f827 BUG: 905946 Signed-off-by: Mohammed Junaid Reviewed-on: http://review.gluster.org/4758 Tested-by: Gluster Build System Reviewed-by: Kaleb KEITHLEY Reviewed-by: Anand Avati --- ufo/gluster/swift/common/Glusterfs.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ufo/gluster/swift/common') diff --git a/ufo/gluster/swift/common/Glusterfs.py b/ufo/gluster/swift/common/Glusterfs.py index 460956a..6cbdf6c 100644 --- a/ufo/gluster/swift/common/Glusterfs.py +++ b/ufo/gluster/swift/common/Glusterfs.py @@ -14,7 +14,7 @@ # limitations under the License. import logging -import os, fcntl, time +import os, sys, fcntl, time, errno from ConfigParser import ConfigParser, NoSectionError, NoOptionError from swift.common.utils import TRUE_VALUES, search_tree from gluster.swift.common.fs_utils import mkdirs @@ -81,7 +81,8 @@ def mount(root, drive): fcntl.lockf(f, fcntl.LOCK_EX|fcntl.LOCK_NB) except: ex = sys.exc_info()[1] - if isinstance(ex, IOError) and ex.errno in (EACCES, EAGAIN): + if isinstance(ex, IOError) and 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) -- cgit