]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - src/allmydata/webish.py
write node.url and portnum files atomically, to fix race in test_runner
[tahoe-lafs/tahoe-lafs.git] / src / allmydata / webish.py
index a8e0bff8e252cc917cc4d82630038c279d46c0eb..813856cb02c53bdb81e06d3953281f20d803aae9 100644 (file)
@@ -163,7 +163,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):