saltstack/salt — pull request #16311 by cimarronm (2014-10-02 05:55:12+00:00)
Title: Bugfix in cmd._run when runas (user) argument is set and python_shell argument is set to False

This fixes a bug in `_run` where it uses `python_shell` boolean in `subprocess.Popen` but the `env_cmd` is not formatted to handle running in a shell (single string) vs. non-shell (list of strings).

Specifically, the sudo/su command to get the user environment when `user` is given does not need to use `python_shell` so changed format to simple list of strings to pass to `Popen`