]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - src/allmydata/webish.py
revert previous commit to fix attribution (vanity)
[tahoe-lafs/tahoe-lafs.git] / src / allmydata / webish.py
index a8e0bff8e252cc917cc4d82630038c279d46c0eb..e2029feecd595ba21bf3516c880189065286569e 100644 (file)
@@ -147,6 +147,7 @@ class WebishServer(service.MultiService):
         self.site = site = appserver.NevowSite(self.root)
         self.site.requestFactory = MyRequest
         self.site.remember(MyExceptionHandler(), inevow.ICanHandleException)
+        self.staticdir = staticdir # so tests can check
         if staticdir:
             self.root.putChild("static", static.File(staticdir))
         if re.search(r'^\d', webport):
@@ -163,7 +164,8 @@ class WebishServer(service.MultiService):
         if nodeurl_path:
             def _write_nodeurl_file(ign):
                 # this file will be created with default permissions
-                fileutil.write(nodeurl_path, self.getURL() + "\n")
+                line = self.getURL() + "\n"
+                fileutil.write_atomically(nodeurl_path, line, mode="")
             self._started.addCallback(_write_nodeurl_file)
 
     def getURL(self):