]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
node.py: use Tub's certFile= argument instead of doing it ourselves
authorBrian Warner <warner@allmydata.com>
Wed, 23 May 2007 19:41:23 +0000 (12:41 -0700)
committerBrian Warner <warner@allmydata.com>
Wed, 23 May 2007 19:41:23 +0000 (12:41 -0700)
src/allmydata/node.py

index 79dc3186bf3927c486738869d0e258c3af58c60e..9bd220003185272b75bd92604019e55fa81a41fb 100644 (file)
@@ -31,15 +31,7 @@ class Node(service.MultiService):
         self._tub_ready_observerlist = observer.OneShotObserverList()
         assert self.CERTFILE, "Your node.Node subclass must provide CERTFILE"
         certfile = os.path.join(self.basedir, self.CERTFILE)
-        try:
-            f = open(certfile, "rb")
-            self.tub = Tub(certData=f.read())
-            f.close()
-        except EnvironmentError:
-            self.tub = Tub()
-            f = open(certfile, "wb")
-            f.write(self.tub.getCertData())
-            f.close()
+        self.tub = Tub(certFile=certfile)
         self.tub.setOption("logLocalFailures", True)
         self.tub.setOption("logRemoteFailures", True)
         self.nodeid = idlib.a2b(self.tub.tubID)