pip shell migration

This commit is contained in:
Thomas S Hatch 2015-01-07 13:24:24 -07:00
parent 0748e70889
commit 7773360b2e

View File

@ -480,7 +480,7 @@ def install(pkgs=None, # pylint: disable=R0912,R0913,R0914
if pre_releases:
# Check the locally installed pip version
pip_version_cmd = '{0} --version'.format(_get_pip_bin(bin_env))
output = __salt__['cmd.run_all'](pip_version_cmd).get('stdout', '')
output = __salt__['cmd.run_all'](pip_version_cmd, python_shell=False).get('stdout', '')
pip_version = output.split()[1]
# From pip v1.4 the --pre flag is available
@ -557,7 +557,7 @@ def install(pkgs=None, # pylint: disable=R0912,R0913,R0914
cmd_kwargs = dict(runas=user, cwd=cwd, saltenv=saltenv)
if bin_env and os.path.isdir(bin_env):
cmd_kwargs['env'] = {'VIRTUAL_ENV': bin_env}
return __salt__['cmd.run_all'](' '.join(cmd), **cmd_kwargs)
return __salt__['cmd.run_all'](' '.join(cmd), python_shell=False, **cmd_kwargs)
finally:
for requirement in cleanup_requirements:
try:
@ -729,7 +729,7 @@ def uninstall(pkgs=None,
pass
cmd.extend(pkgs)
cmd_kwargs = dict(runas=user, cwd=cwd, saltenv=saltenv)
cmd_kwargs = dict(python_shell=False, runas=user, cwd=cwd, saltenv=saltenv)
if bin_env and os.path.isdir(bin_env):
cmd_kwargs['env'] = {'VIRTUAL_ENV': bin_env}
@ -793,7 +793,7 @@ def freeze(bin_env=None,
user = str(runas)
cmd = [_get_pip_bin(bin_env), 'freeze']
cmd_kwargs = dict(runas=user, cwd=cwd)
cmd_kwargs = dict(runas=user, cwd=cwd, python_shell=False)
if bin_env and os.path.isdir(bin_env):
cmd_kwargs['env'] = {'VIRTUAL_ENV': bin_env}
result = __salt__['cmd.run_all'](' '.join(cmd), **cmd_kwargs)
@ -844,7 +844,7 @@ def list_(prefix=None,
elif runas is not None and not user:
user = str(runas)
cmd_kwargs = dict(runas=user, cwd=cwd)
cmd_kwargs = dict(runas=user, cwd=cwd, python_shell=False)
if bin_env and os.path.isdir(bin_env):
cmd_kwargs['env'] = {'VIRTUAL_ENV': bin_env}