Skip to content

Commit

Permalink
python_requirements_info: don't overwrite results in 'mismatched' dic…
Browse files Browse the repository at this point in the history
…t key (#4078)

* bugfix: don't overwrite results in 'mismatched'

Whichever mismatched package is evaluated last is the value stored in the
'mismatched' key. Instead, it should have a subdict for each pkg that is mismatched
to keep in line with its documented usage.

* Update changelogs/fragments/4078-python_requirements_info.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 526369a)
  • Loading branch information
wbh1 authored and patchback[bot] committed Jan 29, 2022
1 parent c40a1e5 commit 7650061
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/4078-python_requirements_info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- python_requirements_info - store ``mismatched`` return values per package as documented in the module (https://github.com/ansible-collections/community.general/pull/4078).
2 changes: 1 addition & 1 deletion plugins/modules/system/python_requirements_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def main():
'desired': dep,
}
else:
results['mismatched'] = {
results['mismatched'][pkg] = {
'installed': existing,
'desired': dep,
}
Expand Down

0 comments on commit 7650061

Please sign in to comment.