summaryrefslogtreecommitdiff
path: root/tools/merge_backup.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/merge_backup.py')
-rwxr-xr-xtools/merge_backup.py8
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)