summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAravinda VK <avishwan@redhat.com>2015-04-28 14:40:27 +0530
committerVijay Bellur <vbellur@redhat.com>2015-05-06 02:20:25 -0700
commit0dea37dd6da379d9c11e6291d187194399b36485 (patch)
tree185b1223407093c06adc1fd9046f19f9e732bfd9 /tools
parent1f7c26edbbb9fa7cfc41ba2f71f6214495c5e4de (diff)
tools/glusterfind: New option to pre --regenerate-outfile
When pre command is run twice, it overwrites the outfile. Now pre command will fail when executed twice. To force the regeneration use --regenerate-outfile Change-Id: I0cf7a139522812ece4decdfbcba667a05ce5c35e Signed-off-by: Aravinda VK <avishwan@redhat.com> BUG: 1218166 Reviewed-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/10418 Reviewed-on: http://review.gluster.org/10522 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/glusterfind/src/main.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/glusterfind/src/main.py b/tools/glusterfind/src/main.py
index 22d4210..ceaf117 100644
--- a/tools/glusterfind/src/main.py
+++ b/tools/glusterfind/src/main.py
@@ -264,6 +264,10 @@ def _get_args():
type=str, default='changelog')
parser_pre.add_argument("--output-prefix", help="File prefix in output",
default=".")
+ parser_pre.add_argument("--regenerate-outfile",
+ help="Regenerate outfile, discard the outfile "
+ "generated from last pre command",
+ action="store_true")
# post <SESSION> <VOLUME>
parser_post = subparsers.add_parser('post')
@@ -381,6 +385,11 @@ def mode_pre(session_dir, args):
mkdirp(os.path.dirname(args.outfile), exit_on_err=True, logger=logger)
+ # If Pre status file exists and running pre command again
+ if os.path.exists(status_file_pre) and not args.regenerate_outfile:
+ fail("Post command is not run after last pre, "
+ "use --regenerate-outfile")
+
start = 0
try:
with open(status_file) as f: