mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +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,6 +56,7 @@ 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 '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):
|
if not os.path.isfile(shell) or not os.access(shell, os.X_OK):
|
||||||
msg = 'The shell {0} is not available'.format(shell)
|
msg = 'The shell {0} is not available'.format(shell)
|
||||||
raise CommandExecutionError(msg)
|
raise CommandExecutionError(msg)
|
||||||
|
@ -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
|
||||||
'''
|
'''
|
||||||
|
# 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)
|
signal.signal(signal.SIGUSR1, _handle_sigusr1)
|
||||||
|
Loading…
Reference in New Issue
Block a user