diff options
Diffstat (limited to 'tools/merge_backup.py')
-rwxr-xr-x | tools/merge_backup.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/merge_backup.py b/tools/merge_backup.py index 48197fc..37b2757 100755 --- a/tools/merge_backup.py +++ b/tools/merge_backup.py @@ -15,12 +15,11 @@ from mergetools import chunks, backup_sendlog, get_logorder, \ hexencode, setverifiedsize, sendentry_merge, verifyroot, \ get_nfetched, parse_args -def merge_backup(args, config, localconfig): +def merge_backup(args, config, localconfig, secondaries): paths = localconfig["paths"] own_key = (localconfig["nodename"], "%s/%s-private.pem" % (paths["privatekeys"], localconfig["nodename"])) - secondaries = config.get("mergenodes", []) mergedb = paths["mergedb"] chainsdir = mergedb + "/chains" logorderfile = mergedb + "/logorder" @@ -138,11 +137,19 @@ def main(): Sleep some and start over. """ args, config, localconfig = parse_args() + all_secondaries = \ + [n for n in config.get('mergenodes', []) if \ + n['name'] != config['primarymergenode']] paths = localconfig["paths"] create_ssl_context(cafile=paths["https_cacertfile"]) + if len(args.node) == 0: + nodes = all_secondaries + else: + nodes = [n for n in all_secondaries if n["name"] in args.node] + while True: - merge_backup(args, config, localconfig) + merge_backup(args, config, localconfig, nodes) if args.interval is None: break print >>sys.stderr, "sleeping", args.interval, "seconds" |