[manage.py] Fix (?) templates rendering issue
This commit is contained in:
parent
c5c8961264
commit
dae1e67dce
1 changed files with 5 additions and 5 deletions
10
manage.py
10
manage.py
|
@ -48,13 +48,11 @@ def pullProj(project):
|
||||||
def renderFile(templateFile):
|
def renderFile(templateFile):
|
||||||
print(f"Rendering file {templateFile}.")
|
print(f"Rendering file {templateFile}.")
|
||||||
|
|
||||||
renderedFile = re.sub('\\.mako$', '.rendered', templateFile)
|
renderedFilename = re.sub('\\.mako$', '.rendered', templateFile)
|
||||||
|
|
||||||
template = Template(filename=templateFile)
|
template = Template(filename=templateFile)
|
||||||
|
|
||||||
descriptor = os.open(renderedFile, os.O_WRONLY|os.O_CREAT, 0o640)
|
outputFile = open(renderedFilename, "w")
|
||||||
|
|
||||||
outputFile = open(descriptor, "w")
|
|
||||||
outputFile.write(template.render(env=env, secrets=secrets))
|
outputFile.write(template.render(env=env, secrets=secrets))
|
||||||
outputFile.close()
|
outputFile.close()
|
||||||
|
|
||||||
|
@ -123,7 +121,9 @@ def setupProj(project):
|
||||||
|
|
||||||
for templateFile in glob(f"projects/{project}/*.mako", include_hidden=True):
|
for templateFile in glob(f"projects/{project}/*.mako", include_hidden=True):
|
||||||
renderFile(templateFile)
|
renderFile(templateFile)
|
||||||
setOwner(re.sub('\\.mako$', '.rendered', templateFile), env['host_uid'], getUid(project))
|
renderedFilename = re.sub('\\.mako$', '.rendered', templateFile)
|
||||||
|
setPerms(renderedFilename, 640)
|
||||||
|
setOwner(renderedFilename, env['host_uid'], getUid(project))
|
||||||
|
|
||||||
upProj(project)
|
upProj(project)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue