diff options
author | Magnus Ahltorp <map@kth.se> | 2015-07-31 08:20:26 +0200 |
---|---|---|
committer | Magnus Ahltorp <map@kth.se> | 2015-07-31 08:20:26 +0200 |
commit | c48e5f1ed73dc0b6c50936c46da10a980dbee545 (patch) | |
tree | a0740e37532851d1484d876428bda844effa40dc /tools/merge.py | |
parent | 88c0aba850f0a79ecf92070f79c6dd3e95b8cc87 (diff) |
Set verifiedsize after merge backup is verifiedmergesecondary-prel
Diffstat (limited to 'tools/merge.py')
-rwxr-xr-x | tools/merge.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tools/merge.py b/tools/merge.py index 34d1697..7453fa4 100755 --- a/tools/merge.py +++ b/tools/merge.py @@ -241,6 +241,23 @@ def verifyroot(node, baseurl, treesize): sys.stderr.flush() raise e +def setverifiedsize(node, baseurl, treesize): + try: + result = http_request(baseurl + "catlfish/merge/setverifiedsize", + json.dumps({"size":treesize}), key=own_key, verifynode=node, publickeydir=paths["publickeys"]) + return json.loads(result) + except urllib2.HTTPError, e: + print >>sys.stderr, "ERROR: setverifiedsize", e.read() + sys.exit(1) + except ValueError, e: + print >>sys.stderr, "==== FAILED REQUEST ====" + print >>sys.stderr, submission + print >>sys.stderr, "======= RESPONSE =======" + print >>sys.stderr, result + print >>sys.stderr, "========================" + sys.stderr.flush() + raise e + def get_missingentries(node, baseurl): try: result = http_request(baseurl + "ct/frontend/missingentries", key=own_key, verifynode=node, publickeydir=paths["publickeys"]) @@ -404,7 +421,7 @@ for secondary in secondaries: print >>sys.stderr, " expected", hexencode(root_hash) sys.exit(1) timing_point(timing, "verifyroot") - # XXX: set verifiedsize + setverifiedsize(nodename, nodeaddress, tree_size) if args.timing: print >>sys.stderr, timing["deltatimes"] sys.stderr.flush() |