From f2be482914f1bc4a653a342f03fc7826ce97ae22 Mon Sep 17 00:00:00 2001 From: Milind Changire Date: Sat, 28 Nov 2015 14:56:02 +0530 Subject: tools/glusterfind: add --full option to query command The --full option will use brickfind.py to list all files in the volume. The output file will contain url-encoded file names prefixed with the tag string to indicate that all files should be considered as new. The default tag string for the --full option is "NEW". This can be changed with the --tag-for-full-find command-line option. Change-Id: Ic85ba5db062e19df13ae9dc2de8a08eacb5c9792 BUG: 1286280 Signed-off-by: Milind Changire Reviewed-on: http://review.gluster.org/12779 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Aravinda VK (cherry picked from commit 16a3f0d020d23978b22a07354c25c654c88163a2) Reviewed-on: http://review.gluster.org/13864 --- tools/glusterfind/src/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tools/glusterfind/src/utils.py') diff --git a/tools/glusterfind/src/utils.py b/tools/glusterfind/src/utils.py index b05f08ee5f6..598cc9e7f46 100644 --- a/tools/glusterfind/src/utils.py +++ b/tools/glusterfind/src/utils.py @@ -75,7 +75,7 @@ def find(path, callback_func=lambda x: True, filter_func=lambda x: True, callback_func(full_path, filter_result) -def output_write(f, path, prefix=".", encode=False): +def output_write(f, path, prefix=".", encode=False, tag=""): if path == "": return @@ -85,7 +85,10 @@ def output_write(f, path, prefix=".", encode=False): if encode: path = urllib.quote_plus(path) - f.write("%s\n" % path) + # set the field separator + FS = "" if tag == "" else " " + + f.write("%s%s%s\n" % (tag.strip(), FS, path)) def human_time(ts): -- cgit