]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
remove "announcement_distinct_hosts" from introweb JSON
authorBrian Warner <warner@lothar.com>
Tue, 22 Sep 2015 23:34:50 +0000 (16:34 -0700)
committerBrian Warner <warner@lothar.com>
Wed, 23 Sep 2015 00:19:47 +0000 (17:19 -0700)
The machine-parseable JSON output for the introducer status web page
used to include a key named "announcement_distinct_hosts", which counted
the number of distinct IP addresses advertised by all connected storage
servers. This hasn't worked since Aug-2014 when foolscap-0.6.5 change
the internal hints format.

This removes that field.

src/allmydata/test/test_system.py
src/allmydata/web/introweb.py

index 4ffbb29cea50f95bbb63ca293962f826171c03b2..1887c7e28b2e4fa4652a9c64c50e8e10c2a0494f 100644 (file)
@@ -812,8 +812,6 @@ class SystemTest(SystemTestMixin, RunBinTahoeMixin, unittest.TestCase):
                                      {"storage": 5})
                 self.failUnlessEqual(data["announcement_summary"],
                                      {"storage": 5})
-                self.failUnlessEqual(data["announcement_distinct_hosts"],
-                                     {"storage": 1})
             except unittest.FailTest:
                 print
                 print "GET %s?t=json output was:" % self.introweb_url
index bbe42d0bb9da1dbfd41b2b211d80ef377181eac0..36bd66b15c5e15b10284a3dbf913b6d1d323e0c0 100644 (file)
@@ -42,28 +42,12 @@ class IntroducerRoot(rend.Page):
         res["subscription_summary"] = counts
 
         announcement_summary = {}
-        service_hosts = {}
         for ad in self.introducer_service.get_announcements():
             service_name = ad.service_name
             if service_name not in announcement_summary:
                 announcement_summary[service_name] = 0
             announcement_summary[service_name] += 1
-            if service_name not in service_hosts:
-                service_hosts[service_name] = set()
-            # it's nice to know how many distinct hosts are available for
-            # each service. We define a "host" by a set of addresses
-            # (hostnames or ipv4 addresses), which we extract from the
-            # connection hints. In practice, this is usually close
-            # enough: when multiple services are run on a single host,
-            # they're usually either configured with the same addresses,
-            # or setLocationAutomatically picks up the same interfaces.
-            host = frozenset(ad.advertised_addresses)
-            service_hosts[service_name].add(host)
         res["announcement_summary"] = announcement_summary
-        distinct_hosts = dict([(name, len(hosts))
-                               for (name, hosts)
-                               in service_hosts.iteritems()])
-        res["announcement_distinct_hosts"] = distinct_hosts
 
         return simplejson.dumps(res, indent=1) + "\n"