Merge pull request #1265 from UtahDave/develop

Fixes for bugs causing minion to crash on Windows.
This commit is contained in:
Thomas S Hatch 2012-05-12 08:02:31 -07:00
commit 1336a2f225
3 changed files with 10 additions and 6 deletions

View File

@ -6,4 +6,4 @@ def shell():
'''
# Provides:
# shell
return {'shell': os.environ.get('SHELL', '/bin/sh'}
return {'shell': os.environ.get('SHELL', '/bin/sh')}

View File

@ -56,9 +56,10 @@ def _run(cmd,
if not cwd:
cwd = os.path.expanduser('~{0}'.format('' if not runas else runas))
if not os.path.isfile(shell) or not os.access(shell, os.X_OK):
msg = 'The shell {0} is not available'.format(shell)
raise CommandExecutionError(msg)
if 'os' in os.environ and not os.environ['os'].startswith('Windows'):
if not os.path.isfile(shell) or not os.access(shell, os.X_OK):
msg = 'The shell {0} is not available'.format(shell)
raise CommandExecutionError(msg)
# TODO: Figure out the proper way to do this in windows
disable_runas = [

View File

@ -40,4 +40,7 @@ def enable_sigusr1_handler():
Pretty print a stack trace to the console or a debug log under /tmp
when any of the salt daemons such as salt-master are sent a SIGUSR1
'''
signal.signal(signal.SIGUSR1, _handle_sigusr1)
# Skip setting up this signal on Windows
# SIGUSR1 doesn't exist on Windows and causes the minion to crash
if 'os' in os.environ and not os.environ['os'].startswith('Windows'):
signal.signal(signal.SIGUSR1, _handle_sigusr1)