diff options
author | josef <josef@josefs-MBP.lan> | 2015-10-01 08:45:45 +0200 |
---|---|---|
committer | josef <josef@josefs-MBP.lan> | 2015-10-01 08:45:45 +0200 |
commit | 127018dc079d58b3dc73bc0bee82d83310df399c (patch) | |
tree | f0e3e3acfcf32ba1d0fa4f9d5cb600c55bbff280 | |
parent | a2fd0e95f27d7a4abd6a7addcf5116714e41bfdf (diff) |
more fine-grained erro handling
-rwxr-xr-x | monitor/josef_monitor.py | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/monitor/josef_monitor.py b/monitor/josef_monitor.py index 7dbd3c6..4b506e8 100755 --- a/monitor/josef_monitor.py +++ b/monitor/josef_monitor.py @@ -73,22 +73,27 @@ class ctlog: if self.build: start_size = self.entries - try: - while self.entries < self.sth["tree_size"]: - tmp_size = self.entries + # try: + while self.entries < self.sth["tree_size"]: + tmp_size = self.entries + try: 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)) + except Exception, e: + print ERROR_STR + "Failed fetch and increment for " + self.name + self.log(ERROR_STR + "Failed fetch and increment tree. Error: " + str(e)) + + 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 = [] |