Skip to content
Permalink
Browse files

Create randomized logfile name in windows for chef.py

  • Loading branch information...
basepi committed Mar 25, 2015
1 parent 5fd1705 commit b49d0d4b5ca5c6f31f03e2caf97cef1088eeed81
Showing with 10 additions and 5 deletions.
  1. +10 −5 salt/modules/chef.py
@@ -6,6 +6,7 @@
# Import Python libs
import logging
import os
import tempfile

# Import Salt libs
import salt.utils
@@ -24,12 +25,16 @@ def __virtual__():


def _default_logfile(exe_name):

'''
Retrieve the logfile name
'''
if salt.utils.is_windows():
logfile = salt.utils.path_join(
os.environ['TMP'],
'{0}.log'.format(exe_name)
)
logfile_tmp = tempfile.NamedTemporaryFile(dir=os.environ['TMP'],
prefix=exe_name,
suffix='.log',
delete=False)
logfile = logfile_tmp.name
logfile_tmp.close()
else:
logfile = salt.utils.path_join(
'/var/log',

0 comments on commit b49d0d4

Please sign in to comment.
You can’t perform that action at this time.