Skip to content

Commit

Permalink
Fix keyring_info when using keyring library (#4964)
Browse files Browse the repository at this point in the history
* Fix keyring_info when using keyring library

This line used to always clobber the passphrase retrieved via the `keyring` library, making it useless on everything except gnome-keyring. After this change, it'll only use the alternate method if the default one didn't work.

* delete whitespace

* add changelog fragment

* Update changelogs/fragments/4964-fix-keyring-info.yml

Co-authored-by: Felix Fontein <[email protected]>

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit e242670)
  • Loading branch information
sargunv authored and patchback[bot] committed Jul 24, 2022
1 parent 371ffae commit 3820c28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/4964-fix-keyring-info.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "keyring_info - fix the result from the keyring library never getting returned (https://github.com/ansible-collections/community.general/pull/4964)."
4 changes: 3 additions & 1 deletion plugins/modules/system/keyring_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ def run_module():
pass
except AttributeError:
pass
passphrase = _alternate_retrieval_method(module)

if passphrase is None:
passphrase = _alternate_retrieval_method(module)

if passphrase is not None:
result["msg"] = "Successfully retrieved password for %s@%s" % (
Expand Down

0 comments on commit 3820c28

Please sign in to comment.