From: Brian Warner Date: Wed, 23 May 2007 19:41:23 +0000 (-0700) Subject: node.py: use Tub's certFile= argument instead of doing it ourselves X-Git-Tag: allmydata-tahoe-0.3.0~66 X-Git-Url: https://git.rkrishnan.org/class-simplejson.JSONEncoder-index.html?a=commitdiff_plain;h=9edc6574ae7b5326aef15a7b13bbfdce0c398be9;p=tahoe-lafs%2Ftahoe-lafs.git node.py: use Tub's certFile= argument instead of doing it ourselves --- 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)