mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Added prefix to tempfile for template
__clean_tmp() only cleans files that have salt.utils.files.TEMPFILE_PREFIX as a prefix, which the jinja rendering didn't set. This causes the /tmp directory to fill up more with each salt run.
This commit is contained in:
parent
96b8b9a849
commit
93a59f8034
1 changed files with 1 additions and 1 deletions
|
@ -189,7 +189,7 @@ def wrap_tmpl_func(render_str):
|
|||
else:
|
||||
if to_str: # then render as string
|
||||
return dict(result=True, data=output)
|
||||
with tempfile.NamedTemporaryFile('wb', delete=False) as outf:
|
||||
with tempfile.NamedTemporaryFile('wb', delete=False, prefix=salt.utils.files.TEMPFILE_PREFIX) as outf:
|
||||
outf.write(SLS_ENCODER(output)[0])
|
||||
# Note: If nothing is replaced or added by the rendering
|
||||
# function, then the contents of the output file will
|
||||
|
|
Loading…
Add table
Reference in a new issue