summaryrefslogtreecommitdiffstats
path: root/gluster
diff options
context:
space:
mode:
authorThiago da Silva <thiago@redhat.com>2013-10-08 13:39:25 -0400
committerLuis Pabon <lpabon@redhat.com>2013-10-10 13:42:31 -0700
commit46cd43fdf401b16f9e1b588e5fc8d2c5dd599b37 (patch)
treeaf6405fa0ce96f4b15a811320ec7cd5da665ae82 /gluster
parent2d56bc3803286b80516652da8f01dcdf96c21d19 (diff)
Adding new unit tests and removed some unused functions
New unit tests help improve test coverage of common/Glusterfs.py code Also removed a function that was no longer being used. Change-Id: Iaa0eed3d2b9ffcc148c1e00b28322ebf93b3f13c Signed-off-by: Thiago da Silva <thiago@redhat.com> Reviewed-on: http://review.gluster.org/6053 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
Diffstat (limited to 'gluster')
-rw-r--r--gluster/swift/common/Glusterfs.py30
1 files changed, 2 insertions, 28 deletions
diff --git a/gluster/swift/common/Glusterfs.py b/gluster/swift/common/Glusterfs.py
index 9ff54ba..55012d3 100644
--- a/gluster/swift/common/Glusterfs.py
+++ b/gluster/swift/common/Glusterfs.py
@@ -21,10 +21,9 @@ import logging
import urllib
from ConfigParser import ConfigParser, NoSectionError, NoOptionError
-from swift.common.utils import TRUE_VALUES, search_tree
+from swift.common.utils import TRUE_VALUES
from gluster.swift.common.fs_utils import do_ismount
-from gluster.swift.common.exceptions import GlusterfsException, \
- FailureToMountError
+from gluster.swift.common.exceptions import FailureToMountError
#
# Read the fs.conf file once at startup (module load)
@@ -286,28 +285,3 @@ def _get_export_list():
export_list.append(item.split(':')[1].strip(' '))
return export_list
-
-
-def get_mnt_point(vol_name, conf_dir=SWIFT_DIR, conf_file="object-server*"):
- """
- Read the object-server's configuration file and return
- the device value.
-
- :param vol_name: target GlusterFS volume name
- :param conf_dir: Swift configuration directory root
- :param conf_file: configuration file name for which to search
- :returns full path to given target volume name
- :raises GlusterfsException if unable to fetch mount point root from
- configuration files
- """
- mnt_dir = ''
- conf_files = search_tree(conf_dir, conf_file, '.conf')
- if not conf_files:
- raise GlusterfsException("Config file, %s, in directory, %s, "
- "not found" % (conf_file, conf_dir))
- _conf = ConfigParser()
- if _conf.read(conf_files[0]):
- mnt_dir = _conf.get('DEFAULT', 'devices', '')
- return os.path.join(mnt_dir, vol_name)
- else:
- raise GlusterfsException("Config file, %s, is empty" % conf_files[0])