diff options
-rwxr-xr-x | monitor/josef_monitor.py | 28 |
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 = [] |