summaryrefslogtreecommitdiff
path: root/monitor/josef_monitor.py
diff options
context:
space:
mode:
authorjosef <josef@josefs-MBP.lan>2015-10-01 08:34:13 +0200
committerjosef <josef@josefs-MBP.lan>2015-10-01 08:34:13 +0200
commita2fd0e95f27d7a4abd6a7addcf5116714e41bfdf (patch)
tree51a4a5f4241826076f9826cdaf0d97704ebb960d /monitor/josef_monitor.py
parentbeaf6e3b91ebfc3a7134398c1607a679434859f7 (diff)
adding error handling for incremental build
Diffstat (limited to 'monitor/josef_monitor.py')
-rwxr-xr-xmonitor/josef_monitor.py28
1 files changed, 16 insertions, 12 deletions
diff --git a/monitor/josef_monitor.py b/monitor/josef_monitor.py
index d5e4254..7dbd3c6 100755
--- a/monitor/josef_monitor.py
+++ b/monitor/josef_monitor.py
@@ -73,18 +73,22 @@ class ctlog:
if self.build:
start_size = self.entries
- while self.entries < self.sth["tree_size"]:
- tmp_size = self.entries
- self.subtree, self.entries = self.fetch_and_increment_subtree(self.entries, self.sth["tree_size"] -1, self.url, self.subtree)
- if tmp_size != self.entries:
- self.log("Got entries " + str(tmp_size) + " to " \
- + str(self.entries -1 ) + " of " + str(self.sth["tree_size"]-1))
-
- if self.entries != start_size:
- if verify_subtree(self.sth, self.subtree, self.url):
- pass
- else:
- self.log(ERROR_STR + "Failed to verify newly built subtree!")
+ try:
+ while self.entries < self.sth["tree_size"]:
+ tmp_size = self.entries
+ self.subtree, self.entries = self.fetch_and_increment_subtree(self.entries, self.sth["tree_size"] -1, self.url, self.subtree)
+ if tmp_size != self.entries:
+ self.log("Got entries " + str(tmp_size) + " to " \
+ + str(self.entries -1 ) + " of " + str(self.sth["tree_size"]-1))
+
+ if self.entries != start_size:
+ if verify_subtree(self.sth, self.subtree, self.url):
+ pass
+ else:
+ self.log(ERROR_STR + "Failed to verify newly built subtree!")
+ except Exception, e:
+ print "Failed incremental build for " + self.name
+ self.log(ERROR_STR + "Failed incremental build. Error: " + str(e))
def fetch_and_increment_subtree(self, first, last, url, subtree =[[]]):
new_leafs = []