From f77af25ef719989575fc11a8552d69b69f73eed6 Mon Sep 17 00:00:00 2001
From: Brian Warner <warner@lothar.com>
Date: Thu, 7 Aug 2008 10:34:33 -0700
Subject: [PATCH] diskwatcher.tac: don't report negative timeleft

---
 misc/spacetime/diskwatcher.tac | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

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