mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-03 06:49:10 -07:00
Allow empty list of names in pip module (#38789)
pip 10 gives exit code 1 for empty argument lists (pip < 10 gave exit 0) see also https://github.com/pypa/pip/pull/4210 To still allow playbooks to pass when giving empty lists, don't call pip in that case, but show a warning.
This commit is contained in:
parent
42953c40ce
commit
d6e711b1de
2 changed files with 17 additions and 2 deletions
|
@ -496,9 +496,13 @@ def main():
|
|||
if name:
|
||||
for pkg in name:
|
||||
cmd += ' %s' % _get_full_name(pkg, version)
|
||||
elif requirements:
|
||||
cmd += ' -r %s' % requirements
|
||||
else:
|
||||
if requirements:
|
||||
cmd += ' -r %s' % requirements
|
||||
module.exit_json(
|
||||
changed=False,
|
||||
warnings=["No valid name or requirements file found."],
|
||||
)
|
||||
|
||||
if module.check_mode:
|
||||
if extra_args or requirements or state == 'latest' or not name:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue