diff --git a/salt/modules/cmdmod.py b/salt/modules/cmdmod.py index 15be7ff596..f3e94eeea8 100644 --- a/salt/modules/cmdmod.py +++ b/salt/modules/cmdmod.py @@ -56,6 +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) + # TODO: Figure out the proper way to do this in windows disable_runas = [ 'Windows',