summaryrefslogtreecommitdiffstats
path: root/tools/glusterfind/src/brickfind.py
diff options
context:
space:
mode:
authorMilind Changire <mchangir@redhat.com>2015-11-28 14:56:02 +0530
committerAravinda VK <avishwan@redhat.com>2016-03-30 21:51:32 -0700
commit16a3f0d020d23978b22a07354c25c654c88163a2 (patch)
tree2ade38395beef8bcf34c63b888e18875ff01bd13 /tools/glusterfind/src/brickfind.py
parent9746ee75865162af1827337f22a553ea0c3ba2ed (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/brickfind.py')
-rw-r--r--tools/glusterfind/src/brickfind.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/glusterfind/src/brickfind.py b/tools/glusterfind/src/brickfind.py
index 57e4c71e750..efc840bca70 100644
--- a/tools/glusterfind/src/brickfind.py
+++ b/tools/glusterfind/src/brickfind.py
@@ -42,7 +42,7 @@ def brickfind_crawl(brick, args):
path = path.strip()
path = path[brick_path_len+1:]
output_write(fout, path, args.output_prefix,
- encode=(not args.no_encode))
+ encode=(not args.no_encode), tag=args.tag)
ignore_dirs = [os.path.join(brick, dirname)
for dirname in
@@ -64,6 +64,9 @@ def _get_args():
parser.add_argument("brick", help="Brick Name")
parser.add_argument("outfile", help="Output File")
parser.add_argument("start", help="Start Time", type=float)
+ parser.add_argument("tag", help="Tag to prefix file name with")
+ parser.add_argument("--only-query", help="Only query, No session update",
+ action="store_true")
parser.add_argument("--debug", help="Debug", action="store_true")
parser.add_argument("--no-encode",
help="Do not encode path in outfile",
@@ -92,6 +95,7 @@ if __name__ == "__main__":
time_to_update = int(time.time())
brickfind_crawl(args.brick, args)
- with open(status_file_pre, "w", buffering=0) as f:
- f.write(str(time_to_update))
+ if not args.only_query:
+ with open(status_file_pre, "w", buffering=0) as f:
+ f.write(str(time_to_update))
sys.exit(0)