From b1593251f9c7f207027671960d6a25d695c0424b Mon Sep 17 00:00:00 2001 From: Michael Vrable Date: Mon, 14 Jul 2008 14:17:57 -0700 Subject: [PATCH] Better cope with null values in the segments_used table. Treat nulls utilization values as 0.0 for cleaning purposes. These shouldn't come up, but may have been generated due to bugs in the SQLite library, so deal gracefully with them instead of failing with an exception. --- lbs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lbs.py b/lbs.py index ee4f445..b8de982 100644 --- a/lbs.py +++ b/lbs.py @@ -583,9 +583,11 @@ class LocalDatabase: info.mtime = row[3] info.age_days = row[4] - # If age is not available for whatever reason, treat it as 0.0. + # If data is not available for whatever reason, treat it as 0.0. if info.age_days is None: info.age_days = 0.0 + if info.used_bytes is None: + info.used_bytes = 0.0 # Benefit calculation: u is the estimated fraction of each segment # which is utilized (bytes belonging to objects still in use -- 2.20.1