summaryrefslogtreecommitdiff
path: root/tools/merge.py
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2015-04-13 14:19:38 +0200
committerLinus Nordberg <linus@nordberg.se>2015-04-13 17:11:07 +0200
commitcf6e64bf94677092ef94a6f4ed7c1391dcd43f23 (patch)
tree903d5a399ce3c4a98fe0a61e51a024c9f4616dda /tools/merge.py
parent2e7ae73196da22dcf9b4817fc38861774ff61b84 (diff)
Run all types of nodes from the same docker image.
Diffstat (limited to 'tools/merge.py')
-rwxr-xr-xtools/merge.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/merge.py b/tools/merge.py
index 0435b77..76ffede 100755
--- a/tools/merge.py
+++ b/tools/merge.py
@@ -226,7 +226,16 @@ def verify_entry(verifycert, entry, hash):
mtl = unpacked[0]
assert hash == get_leaf_hash(mtl)
s = struct.pack(">I", len(entry)) + entry
- verifycert.stdin.write(s)
+ try:
+ verifycert.stdin.write(s)
+ except IOError, e:
+ sys.stderr.write("merge: unable to write to verifycert process: ")
+ while 1:
+ line = verifycert.stdout.readline()
+ if line:
+ sys.stderr.write(line)
+ else:
+ sys.exit(1)
result_length_packed = verifycert.stdout.read(4)
(result_length,) = struct.unpack(">I", result_length_packed)
result = verifycert.stdout.read(result_length)
@@ -251,8 +260,8 @@ for hash in new_entries:
entries_to_fetch[storagenode["name"]].append(hash)
break
-verifycert = subprocess.Popen(paths["verifycert_bin"],
- stdin=subprocess.PIPE, stdout=subprocess.PIPE)
+verifycert = subprocess.Popen([paths["verifycert_bin"], paths["known_roots"]],
+ stdin=subprocess.PIPE, stdout=subprocess.PIPE)
added_entries = 0
for storagenode in storagenodes: