From: Brian Warner <warner@allmydata.com>
Date: Tue, 24 Mar 2009 20:51:37 +0000 (-0700)
Subject: expirer: include crawler progress in the JSON status output
X-Git-Tag: allmydata-tahoe-1.4.0~32
X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty/css/flags?a=commitdiff_plain;h=bd93430c53001dfba7fa34f7cb7c28ccb86977f0;p=tahoe-lafs%2Ftahoe-lafs.git

expirer: include crawler progress in the JSON status output
---

diff --git a/src/allmydata/test/test_storage.py b/src/allmydata/test/test_storage.py
index 0d09678c..aa0bd29e 100644
--- a/src/allmydata/test/test_storage.py
+++ b/src/allmydata/test/test_storage.py
@@ -1731,6 +1731,12 @@ class LeaseCrawler(unittest.TestCase, pollmixin.PollMixin, WebRenderingMixin):
                               "(0 mutable / 0 immutable), 0 B (0 B / 0 B) "
                               "but expiration was not enabled", s)
         d.addCallback(_check_html)
+        d.addCallback(lambda ign: self.render_json(webstatus))
+        def _check_json(json):
+            data = simplejson.loads(json)
+            self.failUnless("lease-checker" in data)
+            self.failUnless("lease-checker-progress" in data)
+        d.addCallback(_check_json)
         return d
 
     def backdate_lease(self, sf, renew_secret, new_expire_time):
diff --git a/src/allmydata/web/storage.py b/src/allmydata/web/storage.py
index ca1775fa..d14e4295 100644
--- a/src/allmydata/web/storage.py
+++ b/src/allmydata/web/storage.py
@@ -29,6 +29,7 @@ class StorageStatus(rend.Page):
         d = {"stats": self.storage.get_stats(),
              "bucket-counter": self.storage.bucket_counter.get_state(),
              "lease-checker": self.storage.lease_checker.get_state(),
+             "lease-checker-progress": self.storage.lease_checker.get_progress(),
              }
         return simplejson.dumps(d, indent=1) + "\n"