diff --git a/salt/grains/extra.py b/salt/grains/extra.py index 110756a20d..38fb9708be 100644 --- a/salt/grains/extra.py +++ b/salt/grains/extra.py @@ -6,4 +6,4 @@ def shell(): ''' # Provides: # shell - return {'shell': os.environ.get('SHELL', '/bin/sh'} + return {'shell': os.environ.get('SHELL', '/bin/sh')} diff --git a/salt/modules/cmdmod.py b/salt/modules/cmdmod.py index cc15640d8c..626c62b5fd 100644 --- a/salt/modules/cmdmod.py +++ b/salt/modules/cmdmod.py @@ -55,10 +55,11 @@ def _run(cmd, # of the user salt-minion is running as. Default: /root 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 = [ diff --git a/salt/utils/debug.py b/salt/utils/debug.py index 49acbd23bc..00282ff937 100644 --- a/salt/utils/debug.py +++ b/salt/utils/debug.py @@ -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)