From e625cc40ff7ce5a4155abf39cf40dacd61deaee2 Mon Sep 17 00:00:00 2001 From: Mohammed Junaid Date: Mon, 21 May 2012 15:47:28 +0530 Subject: 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 Reviewed-on: http://review.gluster.com/3390 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- swift/1.4.8/plugins/utils.py | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'swift/1.4.8/plugins/utils.py') diff --git a/swift/1.4.8/plugins/utils.py b/swift/1.4.8/plugins/utils.py index 57c6180..e28a6bd 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): -- cgit