]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
introweb.py: tolerate non-setLocationed client tubs
authorBrian Warner <warner@allmydata.com>
Wed, 12 Mar 2008 01:09:13 +0000 (18:09 -0700)
committerBrian Warner <warner@allmydata.com>
Wed, 12 Mar 2008 01:09:13 +0000 (18:09 -0700)
src/allmydata/web/introweb.py

index 5a58ca5d08468242a0a1f08b8f7ec5df93cbfd56..8e95dfd583f97d5d6d778dccf2a5626f41020531 100644 (file)
@@ -68,7 +68,11 @@ class IntroducerRoot(rend.Page):
         (service_name, rref) = s
         sr = rref.getSturdyRef()
         nodeid = sr.tubID
-        ctx.fillSlots("peerid", "%s" % idlib.nodeid_b2a(nodeid))
+        # if the subscriber didn't do Tub.setLocation, nodeid will be None
+        nodeid_s = "?"
+        if nodeid:
+            nodeid_s = idlib.nodeid_b2a(nodeid)
+        ctx.fillSlots("peerid", nodeid_s)
         advertised = [loc.split(":")[0] for loc in sr.locationHints]
         ctx.fillSlots("advertised", " ".join(advertised))
         remote_host = rref.tracker.broker.transport.getPeer()