mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Merge pull request #1265 from UtahDave/develop
Fixes for bugs causing minion to crash on Windows.
This commit is contained in:
commit
1336a2f225
@ -6,4 +6,4 @@ def shell():
|
|||||||
'''
|
'''
|
||||||
# Provides:
|
# Provides:
|
||||||
# shell
|
# shell
|
||||||
return {'shell': os.environ.get('SHELL', '/bin/sh'}
|
return {'shell': os.environ.get('SHELL', '/bin/sh')}
|
||||||
|
@ -56,9 +56,10 @@ def _run(cmd,
|
|||||||
if not cwd:
|
if not cwd:
|
||||||
cwd = os.path.expanduser('~{0}'.format('' if not runas else runas))
|
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):
|
if 'os' in os.environ and not os.environ['os'].startswith('Windows'):
|
||||||
msg = 'The shell {0} is not available'.format(shell)
|
if not os.path.isfile(shell) or not os.access(shell, os.X_OK):
|
||||||
raise CommandExecutionError(msg)
|
msg = 'The shell {0} is not available'.format(shell)
|
||||||
|
raise CommandExecutionError(msg)
|
||||||
|
|
||||||
# TODO: Figure out the proper way to do this in windows
|
# TODO: Figure out the proper way to do this in windows
|
||||||
disable_runas = [
|
disable_runas = [
|
||||||
|
@ -40,4 +40,7 @@ def enable_sigusr1_handler():
|
|||||||
Pretty print a stack trace to the console or a debug log under /tmp
|
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
|
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user