summaryrefslogtreecommitdiff
path: root/tools/mergetools.py
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2017-07-26 00:30:49 +0200
committerMagnus Ahltorp <map@kth.se>2017-07-26 00:30:49 +0200
commitc730fa9a23b6d27e5361b7ef1c9b97970df0a60d (patch)
tree86c51be6d1b2f99fc57df128aa58464c3cf357f7 /tools/mergetools.py
parent5105a511348e58629b394373730f9bf91c3e888e (diff)
Use centralized config parsing in initlog.py
Diffstat (limited to 'tools/mergetools.py')
-rw-r--r--tools/mergetools.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/tools/mergetools.py b/tools/mergetools.py
index 0afec24..62b11e4 100644
--- a/tools/mergetools.py
+++ b/tools/mergetools.py
@@ -417,17 +417,18 @@ def get_missingentriesforbackup(node, baseurl, own_key, paths):
def chunks(l, n):
return [l[i:i+n] for i in range(0, len(l), n)]
-def parse_args():
- parser = argparse.ArgumentParser(description="")
- parser.add_argument('node', nargs='*', help="Node to operate on")
- parser.add_argument('--config', help="System configuration",
- required=True)
- parser.add_argument('--localconfig', help="Local configuration",
- required=True)
- parser.add_argument('--interval', type=int, metavar="n",
- help="Repeate every N seconds")
- parser.add_argument("--timing", action='store_true',
- help="Print timing information")
+def parse_args(parser=None):
+ if parser == None:
+ parser = argparse.ArgumentParser(description="")
+ parser.add_argument('node', nargs='*', help="Node to operate on")
+ parser.add_argument('--config', help="System configuration",
+ required=True)
+ parser.add_argument('--localconfig', help="Local configuration",
+ required=True)
+ parser.add_argument('--interval', type=int, metavar="n",
+ help="Repeate every N seconds")
+ parser.add_argument("--timing", action='store_true',
+ help="Print timing information")
args = parser.parse_args()
localconfig = readconfig.read_config(args.localconfig)