summaryrefslogtreecommitdiff
path: root/monitor/josef_monitor.py
diff options
context:
space:
mode:
Diffstat (limited to 'monitor/josef_monitor.py')
-rwxr-xr-xmonitor/josef_monitor.py11
1 files changed, 0 insertions, 11 deletions
diff --git a/monitor/josef_monitor.py b/monitor/josef_monitor.py
index 86b6852..3896493 100755
--- a/monitor/josef_monitor.py
+++ b/monitor/josef_monitor.py
@@ -84,7 +84,6 @@ class ctlog:
try:
self.subtree, self.entries = self.fetch_and_increment_subtree(self.entries, self.sth["tree_size"] -1, self.url, self.subtree)
except Exception, e:
- # print ERROR_STR + "Failed fetch and increment for " + self.name
self.log(ERROR_STR + "Failed fetch and increment tree. Current Size: " + str(self.entries) + " Sth: " + str(self.sth) + " Error: " + str(e))
self.rollback()
return
@@ -192,7 +191,6 @@ class ctlog:
self.log(ERROR_STR + "Could not verify STH signature " + str(new_sth))
self.rollback()
- # sth_time = datetime.datetime.fromtimestamp(new_sth['timestamp'] / 1000, UTC()).strftime("%Y-%m-%d %H:%M:%S")
sth_time = time_str(new_sth["timestamp"])
if new_sth["timestamp"] != self.sth["timestamp"]:
self.log("STH updated. Size: " + str(new_sth["tree_size"]) + ", Time: " + sth_time)
@@ -260,22 +258,17 @@ class ctlog:
try:
if new["tree_size"] == old["tree_size"]:
if old["sha256_root_hash"] != new["sha256_root_hash"]:
- # print ERROR_STR + "Root hash is different for same tree size in " + self.name
self.log(ERROR_STR + "New root hash for same tree size! Old:" + str(old) + " New:" + str(new))
self.rollback()
elif new["tree_size"] < old["tree_size"]:
- # print ERROR_STR + "New tree smaller than previous tree (%d < %d) in %s" % \
- # (new["tree_size"], old["tree_size"], self.name)
self.log(ERROR_STR + "New tree is smaller than old tree! Old:" + str(old) + " New:" + str(new))
self.rollback()
if new["timestamp"] < old["timestamp"]:
self.log(ERROR_STR + "Regression in timestamps! Old:" + str(old) + " New:" + str(new))
self.rollback()
- # print ERROR_STR + " Regression in timestamps in " + self.name
else:
age = time.time() - new["timestamp"]/1000
- # sth_time = datetime.datetime.fromtimestamp(new['timestamp'] / 1000, UTC()).strftime("%Y-%m-%d %H:%M:%S")
sth_time = time_str(new["timestamp"])
roothash = new['sha256_root_hash']
if age > 24 * 3600:
@@ -291,7 +284,6 @@ class ctlog:
except Exception, e:
self.log(ERROR_STR + "Failed to verify progress! Old:" + str(old) + " New:" + str(new) + " Exception: " + str(e))
self.rollback()
- # print "Failed to verify progress in " + self.name
def verify_consistency(self, old):
new = self.sth
@@ -307,17 +299,14 @@ class ctlog:
self.log(ERROR_STR + "Verification of consistency for old hash failed! Old:" \
+ str(old) + " New:" + str(new) + " Proof:" + str(consistency_proof))
self.rollback()
- # print ERROR_STR + "Failed to verify consistency for " + self.name
elif new["sha256_root_hash"] != str(base64.b64encode(res[1])):
self.log(ERROR_STR + "Verification of consistency for new hash failed! Old:" \
+ str(old) + " New:" + str(new) + " Proof:" + str(consistency_proof))
self.rollback()
- # print ERROR_STR + "Failed to verify consistency for " + self.name
except Exception, e:
self.log(ERROR_STR + "Could not verify consistency! " + " Old:" + str(old) + " New:" + str(new) + " Error:" + str(e))
self.rollback()
- # print ERROR_STR + "Could not verify consistency for " + self.url
# def verify_inclusion_all(old, new):