summaryrefslogtreecommitdiff
path: root/tools/merge.py
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2015-03-27 03:08:06 +0100
committerLinus Nordberg <linus@nordberg.se>2015-03-27 11:47:26 +0100
commit6cd3c80c61711cabf9e308da1963b56f6dd49cfd (patch)
tree8d6964fa971f5c38d6d3da2507e0731e4d46b12f /tools/merge.py
parent0fffec2394f2d1962b44eaea4786f9ad69dea901 (diff)
Handle multiple signing nodes
Diffstat (limited to 'tools/merge.py')
-rwxr-xr-xtools/merge.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/merge.py b/tools/merge.py
index 75e72ae..e6fae24 100755
--- a/tools/merge.py
+++ b/tools/merge.py
@@ -34,7 +34,7 @@ storagenodes = config["storagenodes"]
paths = localconfig["paths"]
mergedb = paths["mergedb"]
-signingnode = config["signingnodes"][0]
+signingnodes = config["signingnodes"]
chainsdir = mergedb + "/chains"
logorderfile = mergedb + "/logorder"
@@ -238,8 +238,13 @@ tree_size = len(logorder)
root_hash = tree[-1][0]
timestamp = int(time.time() * 1000)
-tree_head_signature = create_sth_signature(tree_size, timestamp,
- root_hash, "https://%s/" % signingnode["address"], key=own_key)
+for signingnode in signingnodes:
+ try:
+ tree_head_signature = create_sth_signature(tree_size, timestamp,
+ root_hash, "https://%s/" % signingnode["address"], key=own_key)
+ break
+ except urllib2.URLError:
+ pass
sth = {"tree_size": tree_size, "timestamp": timestamp,
"sha256_root_hash": base64.b64encode(root_hash),