1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

pip module: fix unexpected behavior when creating virtualenvs

This module supports `virtualenv_site_packages` as an option to control whether or not to include system packages when installing pip packages into a virtual environment. 

The default is no, and when you say yes it explicitly it includes a flag to include site packages, otherwise it doesn't provide a flag. 

Some versions of virtualenv by default include site packages and other versions by default do not. 

This patch just makes both branches explicit, so `virtualenv_site_packages=no` really means no.
This commit is contained in:
chrisalbright 2013-10-30 17:27:02 -07:00
parent 078aaa95a2
commit 44c2fae805

View file

@ -247,7 +247,7 @@ def main():
if module.params['virtualenv_site_packages']: if module.params['virtualenv_site_packages']:
cmd = '%s --system-site-packages %s' % (virtualenv, env) cmd = '%s --system-site-packages %s' % (virtualenv, env)
else: else:
cmd = '%s %s' % (virtualenv, env) cmd = '%s --no-site-packages %s' % (virtualenv, env)
os.chdir(tempfile.gettempdir()) os.chdir(tempfile.gettempdir())
if chdir: if chdir:
os.chdir(chdir) os.chdir(chdir)