summaryrefslogtreecommitdiffstats
path: root/swift/1.4.8/plugins/utils.py
diff options
context:
space:
mode:
authorMohammed Junaid <junaid@redhat.com>2012-05-21 15:47:28 +0530
committerVijay Bellur <vijay@gluster.com>2012-05-21 22:14:39 -0700
commit93893b9ac06479bdfe28f94fce961594b928121a (patch)
tree4db2b2f1e7757d78c6161685b6b8919f3e75be1a /swift/1.4.8/plugins/utils.py
parentafc623f85e766a9006d7ba7cb81123ca3e10a719 (diff)
swift: Passing account name in container_update.
This patch also contains fixes to bugs * 811501 * 812498 * 821310 Also, removed the default set of users in the proxy-server.conf file. Change-Id: Ief83905d10ff7bf7c43685ada4d7f05959cee9d1 BUG: 821310 Signed-off-by: Mohammed Junaid <junaid@redhat.com> Reviewed-on: http://review.gluster.com/3390 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'swift/1.4.8/plugins/utils.py')
-rw-r--r--swift/1.4.8/plugins/utils.py24
1 files changed, 6 insertions, 18 deletions
diff --git a/swift/1.4.8/plugins/utils.py b/swift/1.4.8/plugins/utils.py
index 57c6180fd..e28a6bd85 100644
--- a/swift/1.4.8/plugins/utils.py
+++ b/swift/1.4.8/plugins/utils.py
@@ -323,33 +323,21 @@ def check_user_xattr(path):
def _check_valid_account(account, fs_object):
mount_path = getattr(fs_object, 'mount_path', MOUNT_PATH)
- if not check_account_exists(fs_object.get_export_from_account_id(account), \
- fs_object):
+ if os.path.ismount(os.path.join(mount_path, account)):
+ return True
+
+ if not check_account_exists(fs_object.get_export_from_account_id(account), fs_object):
logging.error('Account not present %s', account)
return False
- if not os.path.ismount(os.path.join(mount_path, account)):
- if not os.path.isdir(os.path.join(mount_path, account)):
- mkdirs(os.path.join(mount_path, account))
-
+ if not os.path.isdir(os.path.join(mount_path, account)):
+ mkdirs(os.path.join(mount_path, account))
fs_object.unmount(os.path.join(mount_path, account))
if fs_object:
if not fs_object.mount(account):
return False
- if not check_user_xattr(os.path.join(mount_path, account)):
- logging.error('Error: No support for user.xattr on backend %s' % account)
- return False
-
- chmod_cmd = ['chmod 777 %s' % (mount_path), \
- 'chmod 777 %s/%s' % (mount_path, account)]
-
- for cmd in chmod_cmd:
- if os.system(cmd):
- logging.error('Chmod failed: %s' % (cmd))
- return False
-
return True
def check_valid_account(account, fs_object):