From: Brian Warner Date: Thu, 7 Aug 2008 17:34:33 +0000 (-0700) Subject: diskwatcher.tac: don't report negative timeleft X-Git-Url: https://git.rkrishnan.org/tahoe_css?a=commitdiff_plain;h=f77af25ef719989575fc11a8552d69b69f73eed6;p=tahoe-lafs%2Ftahoe-lafs.git diskwatcher.tac: don't report negative timeleft --- diff --git a/misc/spacetime/diskwatcher.tac b/misc/spacetime/diskwatcher.tac index 15e5d47f..9780e2dd 100644 --- a/misc/spacetime/diskwatcher.tac +++ b/misc/spacetime/diskwatcher.tac @@ -160,10 +160,9 @@ class DiskWatcher(service.MultiService, resource.Resource): growth = self.growth(timespan) print name, total_avail_space, growth if growth is not None: - try: + timeleft = None + if growth > 0: timeleft = total_avail_space / growth - except ZeroDivisionError: - timeleft = None timespans.append( (name, timespan, growth, timeleft) ) return timespans