introweb.py: tolerate non-setLocationed client tubs

This commit is contained in:
Brian Warner 2008-03-11 18:09:13 -07:00
parent 3f5abe5cba
commit fd5a922cad

View File

@ -68,7 +68,11 @@ class IntroducerRoot(rend.Page):
(service_name, rref) = s (service_name, rref) = s
sr = rref.getSturdyRef() sr = rref.getSturdyRef()
nodeid = sr.tubID 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] advertised = [loc.split(":")[0] for loc in sr.locationHints]
ctx.fillSlots("advertised", " ".join(advertised)) ctx.fillSlots("advertised", " ".join(advertised))
remote_host = rref.tracker.broker.transport.getPeer() remote_host = rref.tracker.broker.transport.getPeer()