Use cachedir

This commit is contained in:
Colton Myers 2015-03-25 16:01:20 -06:00
parent b49d0d4b5c
commit 22d2f7a1ec

View File

@ -29,7 +29,10 @@ def _default_logfile(exe_name):
Retrieve the logfile name
'''
if salt.utils.is_windows():
logfile_tmp = tempfile.NamedTemporaryFile(dir=os.environ['TMP'],
tmp_dir = os.path.join(__opts__['cachedir'], 'tmp')
if not os.path.isdir(tmp_dir):
os.mkdir(tmp_dir)
logfile_tmp = tempfile.NamedTemporaryFile(dir=tmp_dir,
prefix=exe_name,
suffix='.log',
delete=False)