summaryrefslogtreecommitdiff
path: root/tools/mergetools.py
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2015-11-12 00:53:29 +0100
committerMagnus Ahltorp <map@kth.se>2015-11-12 00:53:29 +0100
commit0e58634a718acd025ac5f1ed9e385e064e530523 (patch)
treea3173e9f860e07e4ad8ab480bfbef84df4604b28 /tools/mergetools.py
parent45b5f0500b125245dc4a10e3fcbf4c83a6bc4946 (diff)
Send many entries at a time in merge_backup
Diffstat (limited to 'tools/mergetools.py')
-rw-r--r--tools/mergetools.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/mergetools.py b/tools/mergetools.py
index 89ba7b2..3dbe517 100644
--- a/tools/mergetools.py
+++ b/tools/mergetools.py
@@ -306,11 +306,14 @@ def sendentry(node, baseurl, own_key, paths, entry, ehash):
raise e
def sendentry_merge(node, baseurl, own_key, paths, entry, ehash):
+ return sendentries_merge(node, baseurl, own_key, paths, [(ehash, entry)])
+
+def sendentries_merge(node, baseurl, own_key, paths, entries):
try:
+ json_entries = [{"entry":base64.b64encode(entry), "treeleafhash":base64.b64encode(hash)} for hash, entry in entries]
result = http_request(
baseurl + "plop/v1/merge/sendentry",
- json.dumps({"entry":base64.b64encode(entry),
- "treeleafhash":base64.b64encode(ehash)}),
+ json.dumps(json_entries),
key=own_key, verifynode=node, publickeydir=paths["publickeys"])
return json.loads(result)
except urllib2.URLError, e: