mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
pip: combine chdir and env only when env is set (#40793)
* pip: combine chdir and env only when env is set This fixes an AttributeError when chdir without virtualenv is specified: File "/tmp/ansible_2UAFsZ/ansible_module_pip.py", line 387, in main env = os.path.join(chdir, env) File "/usr/lib64/python2.7/posixpath.py", line 75, in join if b.startswith('/'): AttributeError: 'NoneType' object has no attribute 'startswith' * Add test for pip with chdir Signed-off-by: Till Maas <opensource@till.name>
This commit is contained in:
parent
fd4e774cec
commit
bb85bbceeb
4 changed files with 59 additions and 1 deletions
|
@ -457,7 +457,7 @@ def main():
|
|||
env = module.params['virtualenv']
|
||||
|
||||
venv_created = False
|
||||
if chdir:
|
||||
if env and chdir:
|
||||
env = os.path.join(chdir, env)
|
||||
|
||||
if umask and not isinstance(umask, int):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue