summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Portante <peter.portante@redhat.com>2012-10-29 19:49:42 -0400
committerVijay Bellur <vbellur@redhat.com>2012-11-16 04:43:48 -0800
commit92fed1249752ff1feb6cd0b004e9550ba666a7b0 (patch)
tree96c1e56e2deff239adfa56c5d021c1cb04d273a2
parentf3daa0bda0aa429cbf148fcef41cf34564828e4d (diff)
object-storage: fix bad refs to check_acct_exists
Fix bad references to check_account_exists: this is a module local method, not provided by Glusterfs. Not sure how we missed this. More unit tests would help. Also added the ability to run the Swift tree unit tests with gluster artificially enabled to test as many code paths as possible ahead of full functional tests. Change-Id: Iaf696d34db8f841c887f03569e65321fca8894d1 Signed-off-by: Peter Portante <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/4171 Reviewed-by: Pete Zaitcev <zaitcev@redhat.com> Reviewed-by: Mohammed Junaid <junaid@redhat.com> Tested-by: Kaleb KEITHLEY <kkeithle@redhat.com>
-rw-r--r--swift/1.4.8/plugins/utils.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/swift/1.4.8/plugins/utils.py b/swift/1.4.8/plugins/utils.py
index bc16ff6f738..838c1bd75e9 100644
--- a/swift/1.4.8/plugins/utils.py
+++ b/swift/1.4.8/plugins/utils.py
@@ -163,7 +163,7 @@ def _check_valid_account(account):
if os.path.ismount(full_mount_path):
return True
- if not Glusterfs.check_account_exists(Glusterfs.get_export_from_account_id(account)):
+ if not _check_account_exists(Glusterfs.get_export_from_account_id(account)):
logging.error('Account not present %s', account)
return False
@@ -481,7 +481,7 @@ def create_account_metadata(acc_path, memcache=None):
metadata = get_account_metadata(acc_path, memcache)
return restore_metadata(acc_path, metadata)
-def check_account_exists(account):
+def _check_account_exists(account):
if account not in get_account_list():
logging.warn('Account %s does not exist' % account)
return False
@@ -495,13 +495,15 @@ def get_account_id(account):
return RESELLER_PREFIX + md5(account + HASH_PATH_SUFFIX).hexdigest()
+_DEFAULT_GLUSTER_ENABLED = os.getenv('GLUSTER_UNIT_TEST_ENABLED', 'no')
__swift_conf = ConfigParser()
__swift_conf.read(os.path.join('/etc/swift', 'swift.conf'))
try:
- _gluster_enabled = __swift_conf.get('DEFAULT', 'Enable_plugin', 'no') in TRUE_VALUES
+ _gluster_enabled_val = __swift_conf.get('DEFAULT', 'Enable_plugin', _DEFAULT_GLUSTER_ENABLED)
except NoOptionError, NoSectionError:
- _gluster_enabled = False
+ _gluster_enabled_val = _DEFAULT_GLUSTER_ENABLED
del __swift_conf
+_gluster_enabled = _gluster_enabled_val in TRUE_VALUES
def Gluster_enabled():
return _gluster_enabled