summaryrefslogtreecommitdiffstats
path: root/tools/glusterfind/src/brickfind.py
diff options
context:
space:
mode:
authorAravinda VK <avishwan@redhat.com>2016-02-19 17:08:56 +0530
committerVenky Shankar <vshankar@redhat.com>2016-02-26 02:11:08 -0800
commit1b897c39ba8c0f1bf180316637cc2d87e6920800 (patch)
tree78f974a872e202c831d63e275e7fccb6e2a3eda3 /tools/glusterfind/src/brickfind.py
parentbf2004bc1346890e69292c5177a5d8e002b696e2 (diff)
tools/glusterfind: New option --no-encode
New option added to skip encoding path in output file. Also handled Unicode strings. File paths can have newline characters, to differentiate between each path patch is encoded according to RFC3986(https://www.ietf.org/rfc/rfc3986.txt). Due to this consumer applications have to decode the path before consuming it. With this option Paths are not encoded, can be directly consumed by applications. Unicode encoding is handled automatically BUG: 1310080 Change-Id: I83d59831997dbd1264b48e9b1aa732c7dfc700b5 Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/13477 Smoke: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Milind Changire <mchangir@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Kotresh HR <khiremat@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com>
Diffstat (limited to 'tools/glusterfind/src/brickfind.py')
-rw-r--r--tools/glusterfind/src/brickfind.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/glusterfind/src/brickfind.py b/tools/glusterfind/src/brickfind.py
index f300638d602..57e4c71e750 100644
--- a/tools/glusterfind/src/brickfind.py
+++ b/tools/glusterfind/src/brickfind.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# -*- coding: utf-8 -*-
# Copyright (c) 2015 Red Hat, Inc. <http://www.redhat.com/>
# This file is part of GlusterFS.
@@ -40,7 +41,8 @@ def brickfind_crawl(brick, args):
def output_callback(path, filter_result):
path = path.strip()
path = path[brick_path_len+1:]
- output_write(fout, path, args.output_prefix, encode=True)
+ output_write(fout, path, args.output_prefix,
+ encode=(not args.no_encode))
ignore_dirs = [os.path.join(brick, dirname)
for dirname in
@@ -63,6 +65,9 @@ def _get_args():
parser.add_argument("outfile", help="Output File")
parser.add_argument("start", help="Start Time", type=float)
parser.add_argument("--debug", help="Debug", action="store_true")
+ parser.add_argument("--no-encode",
+ help="Do not encode path in outfile",
+ action="store_true")
parser.add_argument("--output-prefix", help="File prefix in output",
default=".")