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
This commit is contained in:
parent
ad588336ac
commit
80b63eced6
|
@ -1,6 +1,5 @@
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import tempfile
|
|
||||||
import html_helper
|
import html_helper
|
||||||
from Cheetah.Template import Template
|
from Cheetah.Template import Template
|
||||||
from distutils.dir_util import copy_tree
|
from distutils.dir_util import copy_tree
|
||||||
|
@ -32,7 +31,7 @@ def _create_json(out_dir, name_space={}):
|
||||||
'feedback': {'lowest': mp.lowest_feedback,
|
'feedback': {'lowest': mp.lowest_feedback,
|
||||||
'highest': mp.highest_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)
|
json.dump(data, f, indent=2)
|
||||||
os.rename(f.name, os.path.join(out_dir, 'reviewday.json'))
|
os.rename(f.name, os.path.join(out_dir, 'reviewday.json'))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue