clients now get the queen's pburl from a file named roster_pburl, not hardcoded in the .tac file

This commit is contained in:
Brian Warner 2006-12-04 04:27:40 -07:00
parent a3700cc582
commit 5be5230767
2 changed files with 6 additions and 4 deletions

View File

@ -23,6 +23,7 @@ class Client(node.Node, Referenceable):
STOREDIR = 'storage'
NODETYPE = "client"
WEBPORTFILE = "webport"
QUEEN_PBURL_FILE = "roster_pburl"
def __init__(self, basedir="."):
node.Node.__init__(self, basedir)
@ -40,6 +41,11 @@ class Client(node.Node, Referenceable):
f.close()
self.add_service(WebishServer(webport))
self.queen_pburl = None
QUEEN_PBURL_FILE = os.path.join(self.basedir, self.QUEEN_PBURL_FILE)
if os.path.exists(QUEEN_PBURL_FILE):
f = open(QUEEN_PBURL_FILE, "r")
self.queen_pburl = f.read().strip()
f.close()
self.queen_connector = None
def tub_ready(self):

View File

@ -3,11 +3,7 @@
from allmydata import client
from twisted.application import service
queen_pburl = "pb://jekyv6ghn7zinppk7wcvfmk7o4gw76hb@192.168.1.101:42552/roster"
yumyum_queen = "pb://cznyjh2pi4bybn3g7pi36bdfnwz356vk@192.168.1.98:56510/roster"
c = client.Client()
c.set_queen_pburl(yumyum_queen)
#c.set_queen_pburl(queen_pburl)
application = service.Application("allmydata_client")
c.setServiceParent(application)