From 054f25581cee55bfac24092772e2df5de0d6393a Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Fri, 1 Feb 2008 20:07:08 -0700 Subject: [PATCH] client.py: touch BASEDIR/no_storage to not publish a storage server. Addresses #271 --- src/allmydata/client.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/allmydata/client.py b/src/allmydata/client.py index 92ea6fa2..f18e8ea0 100644 --- a/src/allmydata/client.py +++ b/src/allmydata/client.py @@ -148,18 +148,17 @@ class Client(node.Node, Referenceable, testutil.PollMixin): self.log("tub_ready") node.Node.tub_ready(self) - # we use separate get_config/write_config here because we want to - # update the connection hints each time. - my_old_name = None - my_old_furl = self.get_config("myself.furl") - if my_old_furl is not None: - sturdy = SturdyRef(my_old_furl) - my_old_name = sturdy.name - - self.my_furl = self.tub.registerReference(self, my_old_name) - self.write_config("myself.furl", self.my_furl + "\n") - - ic = IntroducerClient(self.tub, self.introducer_furl, self.my_furl) + furl_file = os.path.join(self.basedir, "myself.furl") + self.my_furl = self.tub.registerReference(self, furlFile=furl_file) + + # should we publish ourselves as a server? + provide_storage = (self.get_config("no_storage") is None) + if provide_storage: + my_furl = self.my_furl + else: + my_furl = None + + ic = IntroducerClient(self.tub, self.introducer_furl, my_furl) self.introducer_client = ic ic.setServiceParent(self) -- 2.45.2