diskwatcher.tac: don't report negative timeleft

This commit is contained in:
Brian Warner 2008-08-07 10:34:33 -07:00
parent 7502971df6
commit f77af25ef7

View File

@ -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