Ensure config files are readable by all.

This commit is contained in:
Tim Miller 2013-03-18 11:44:26 -07:00
parent 1db777fd9e
commit 9883a86228

View File

@ -43,6 +43,7 @@ def write_file(path, contents):
os.path.exists(d) or os.makedirs(d)
with NamedTemporaryFile(dir=d, delete=False) as newfile:
newfile.write(contents)
os.chmod(newfile.name, 0644)
os.rename(newfile.name, path)
# return a map of filenames->filecontents