diff options
author | Milind Changire <mchangir@redhat.com> | 2015-11-28 14:56:02 +0530 |
---|---|---|
committer | Aravinda VK <avishwan@redhat.com> | 2016-03-30 21:51:32 -0700 |
commit | 16a3f0d020d23978b22a07354c25c654c88163a2 (patch) | |
tree | 2ade38395beef8bcf34c63b888e18875ff01bd13 /tools/glusterfind/src/utils.py | |
parent | 9746ee75865162af1827337f22a553ea0c3ba2ed (diff) |
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: 1286279
Signed-off-by: Milind Changire <mchangir@redhat.com>
Reviewed-on: http://review.gluster.org/12779
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Diffstat (limited to 'tools/glusterfind/src/utils.py')
-rw-r--r-- | tools/glusterfind/src/utils.py | 7 |
1 files changed, 5 insertions, 2 deletions
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): |