diff options
author | Saravanakumar Arumugam <sarumuga@redhat.com> | 2015-07-17 15:51:22 +0530 |
---|---|---|
committer | Venky Shankar <vshankar@redhat.com> | 2015-08-26 23:21:23 -0700 |
commit | 0c47ef608b22ce719a0238c292cd8550986ad0cd (patch) | |
tree | 77f6ce8263d0e767300c16d13722038b361aa11c /tools/glusterfind/src/utils.py | |
parent | a26dbb38acdb2ec5fe16068caee189709faae76e (diff) |
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 <sarumuga@redhat.com>
Reviewed-on: http://review.gluster.org/11712
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Diffstat (limited to 'tools/glusterfind/src/utils.py')
-rw-r--r-- | tools/glusterfind/src/utils.py | 13 |
1 files changed, 13 insertions, 0 deletions
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) |