diff options
author | Magnus Ahltorp <map@kth.se> | 2016-07-08 16:51:55 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2016-07-11 15:37:01 +0200 |
commit | b6ce64e114022ea23668cd69ce0ef7517dbe68ad (patch) | |
tree | 9c1b3a3e32e7e35bfd57fa98272b367e1545d403 /tools/merge_backup.py | |
parent | e43a199b241d74f7a5ad046139a318576cdf21b6 (diff) |
Added permdb support to merge
Diffstat (limited to 'tools/merge_backup.py')
-rwxr-xr-x | tools/merge_backup.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/merge_backup.py b/tools/merge_backup.py index ac16a6a..abe9f36 100755 --- a/tools/merge_backup.py +++ b/tools/merge_backup.py @@ -12,9 +12,9 @@ from time import sleep from certtools import timing_point, build_merkle_tree, write_file, \ create_ssl_context from mergetools import chunks, backup_sendlog, get_logorder, \ - get_verifiedsize, get_missingentriesforbackup, read_chain, \ + get_verifiedsize, get_missingentriesforbackup, \ hexencode, setverifiedsize, sendentries_merge, verifyroot, \ - get_nfetched, parse_args + get_nfetched, parse_args, perm def backup_loop(nodename, nodeaddress, own_key, paths, verifiedsize, chunk): for trynumber in range(5, 0, -1): @@ -37,7 +37,7 @@ def merge_backup(args, config, localconfig, secondaries): "%s/%s-private.pem" % (paths["privatekeys"], localconfig["nodename"])) mergedb = paths["mergedb"] - chainsdir = mergedb + "/chains" + chainsdb = perm(localconfig.get("dbbackend", "filedb"), mergedb + "/chains") logorderfile = mergedb + "/logorder" currentsizefile = mergedb + "/fetched" timing = timing_point() @@ -119,7 +119,7 @@ def merge_backup(args, config, localconfig, secondaries): with requests.sessions.Session() as session: for missingentry_chunk in chunks(missingentries, 100): missingentry_hashes = [base64.b64decode(missingentry) for missingentry in missingentry_chunk] - hashes_and_entries = [(hash, read_chain(chainsdir, hash)) for hash in missingentry_hashes] + hashes_and_entries = [(hash, chainsdb.get(hash)) for hash in missingentry_hashes] sendentryresult = sendentries_merge(nodename, nodeaddress, own_key, paths, hashes_and_entries, session) |