From 0c47ef608b22ce719a0238c292cd8550986ad0cd Mon Sep 17 00:00:00 2001 From: Saravanakumar Arumugam Date: Fri, 17 Jul 2015 15:51:22 +0530 Subject: tools/glusterfind: Prepend prefix in case of delete In case of delete operation alone, output prefix adding was not handled earlier. Output prefix is added now. Change-Id: Ia91444dddbff501b26a864f6185ca4c0aaf4c802 BUG: 1244144 Signed-off-by: Saravanakumar Arumugam Reviewed-on: http://review.gluster.org/11712 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Aravinda VK Reviewed-by: Milind Changire --- tools/glusterfind/src/utils.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tools/glusterfind/src/utils.py') diff --git a/tools/glusterfind/src/utils.py b/tools/glusterfind/src/utils.py index cda5ea6378e..fdf61fe0f9e 100644 --- a/tools/glusterfind/src/utils.py +++ b/tools/glusterfind/src/utils.py @@ -226,3 +226,16 @@ def get_changelog_rollover_time(volumename): return int(tree.find('volGetopts/Value').text) except ParseError: return DEFAULT_CHANGELOG_INTERVAL + + +def output_path_prepare(path, output_prefix): + """ + If Prefix is set, joins to Path, removes ending slash + and encodes it. + """ + if output_prefix != ".": + path = os.path.join(output_prefix, path) + if path.endswith("/"): + path = path[0:len(path)-1] + + return urllib.quote_plus(path) -- cgit