From 80b63eced6dadd25f0896ebe2fa43c4313919e2a Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Tue, 11 Feb 2014 10:34:35 -0500 Subject: [PATCH] Make reviewday.json world readable. Because we were using a python tempfile the reviewday.json file was readable/writable only by the user that runs bin/reviewday. Ideally this file would be world readable so that Apache can host it properly. In this commit we drop the use of python tempfile in favor of just plain old open() which respects the normal file permission settings. This should fix a Forbidden access error I get when trying to access http://status.openstack.org/reviews/reviewday.json today. Closes-bug: #1273833 Change-Id: I9e9a76e29f5c71f2496eef96a6dbf2496c42d973 --- reviewday/util.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reviewday/util.py b/reviewday/util.py index 6c8dcd8..f70477a 100644 --- a/reviewday/util.py +++ b/reviewday/util.py @@ -1,6 +1,5 @@ import json import os -import tempfile import html_helper from Cheetah.Template import Template from distutils.dir_util import copy_tree @@ -32,7 +31,7 @@ def _create_json(out_dir, name_space={}): 'feedback': {'lowest': mp.lowest_feedback, 'highest': mp.highest_feedback, }, } - with tempfile.NamedTemporaryFile(dir=out_dir, delete=False) as f: + with open(os.path.join(out_dir, 'reviewday.json.tmp'), "w") as f: json.dump(data, f, indent=2) os.rename(f.name, os.path.join(out_dir, 'reviewday.json'))