summaryrefslogtreecommitdiff
path: root/tools/merge_fetch.py
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2017-03-08 18:45:47 +0100
committerLinus Nordberg <linus@nordu.net>2017-03-15 17:45:32 +0100
commit6deee0427c3e4934291b1103328d4c3d75d56e29 (patch)
tree7f56ec8cd9bce774426f2c769b6cd5c931ce1aaf /tools/merge_fetch.py
parent8e4cd93fd1ab8fa148256633f3eb261a5bd1d311 (diff)
Added heartbeat service. Add source.
Diffstat (limited to 'tools/merge_fetch.py')
-rwxr-xr-xtools/merge_fetch.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/merge_fetch.py b/tools/merge_fetch.py
index 2a2491d..b0b6ce6 100755
--- a/tools/merge_fetch.py
+++ b/tools/merge_fetch.py
@@ -24,8 +24,9 @@ def reportstatus(statusservers, own_key, target, variable, status):
def do_reportstatus(node, baseurl, own_key, target, variable, status):
try:
+ (ownname, _) = own_key
result = http_request(baseurl + "plop/v1/status/merge_fetch",
- json.dumps([{"target":target, "key": variable, "value": status}]), key=own_key,
+ json.dumps([{"source":ownname, "target":target, "key": variable, "value": status}]), key=own_key,
verifynode=node)
return json.loads(result)
except requests.exceptions.HTTPError, e:
@@ -79,7 +80,7 @@ def merge_fetch(args, config, localconfig, currentsizefile):
new_entries -= certsinlog
print >>sys.stderr, "adding", len(new_entries), "entries"
sys.stderr.flush()
- reportstatus(statusservers, own_key, "fetch", "total", len(certsinlog) + len(new_entries))
+ reportstatus(statusservers, own_key, own_key[0], "total", len(certsinlog) + len(new_entries))
for ehash in new_entries:
for storagenode in storagenodes:
@@ -123,7 +124,7 @@ def merge_fetch(args, config, localconfig, currentsizefile):
tree_size = len(logorder)
currentsize = {"index": tree_size - 1, "hash": hexencode(logorder[tree_size-1])}
write_file(currentsizefile, currentsize)
- reportstatus(statusservers, own_key, "fetch", "fetched", tree_size)
+ reportstatus(statusservers, own_key, own_key[0], "fetched", tree_size)
print >>sys.stderr, added_entries,
sys.stderr.flush()
print >>sys.stderr
@@ -141,7 +142,7 @@ def merge_fetch(args, config, localconfig, currentsizefile):
sys.stderr.flush()
tree_size = len(logorder)
- reportstatus(statusservers, own_key, "fetch", "fetched", tree_size)
+ reportstatus(statusservers, own_key, own_key[0], "fetched", tree_size)
if tree_size == 0:
return (0, '')
else: