mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Resolves issues with newer versions of pip not having a --use-mirrors paramater for the install command
This commit is contained in:
parent
28b9fd4e30
commit
191be7b951
1 changed files with 6 additions and 1 deletions
|
@ -275,6 +275,7 @@ def main():
|
||||||
pip = _get_pip(module, env, module.params['executable'])
|
pip = _get_pip(module, env, module.params['executable'])
|
||||||
|
|
||||||
cmd = '%s %s' % (pip, state_map[state])
|
cmd = '%s %s' % (pip, state_map[state])
|
||||||
|
cmd_opts = None
|
||||||
|
|
||||||
# If there's a virtualenv we want things we install to be able to use other
|
# If there's a virtualenv we want things we install to be able to use other
|
||||||
# installations that exist as binaries within this virtualenv. Example: we
|
# installations that exist as binaries within this virtualenv. Example: we
|
||||||
|
@ -319,7 +320,11 @@ def main():
|
||||||
is_local_path = True
|
is_local_path = True
|
||||||
# for tarball or vcs source, applying --use-mirrors doesn't really make sense
|
# for tarball or vcs source, applying --use-mirrors doesn't really make sense
|
||||||
is_package = is_vcs or is_tar or is_local_path # just a shortcut for bool
|
is_package = is_vcs or is_tar or is_local_path # just a shortcut for bool
|
||||||
if not is_package and state != 'absent' and use_mirrors:
|
|
||||||
|
if cmd_opts is None:
|
||||||
|
cmd_opts = _get_cmd_options(module, cmd)
|
||||||
|
|
||||||
|
if not is_package and state != 'absent' and use_mirrors and '--use-mirrors' in cmd_opts:
|
||||||
cmd += ' --use-mirrors'
|
cmd += ' --use-mirrors'
|
||||||
cmd += ' %s' % _get_full_name(name, version)
|
cmd += ' %s' % _get_full_name(name, version)
|
||||||
elif requirements:
|
elif requirements:
|
||||||
|
|
Loading…
Reference in a new issue