Add shell checking to cmdmod since shell can be defined.

This commit is contained in:
Jeff Hutchins 2012-05-09 23:54:08 -06:00
parent 620cc3eadc
commit c58d9aedc2

View File

@ -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',