From 9edc6574ae7b5326aef15a7b13bbfdce0c398be9 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Wed, 23 May 2007 12:41:23 -0700 Subject: [PATCH] node.py: use Tub's certFile= argument instead of doing it ourselves --- src/allmydata/node.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/allmydata/node.py b/src/allmydata/node.py index 79dc3186..9bd22000 100644 --- a/src/allmydata/node.py +++ b/src/allmydata/node.py @@ -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) -- 2.45.2