1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

fix passwordstore.py to be compatible with gopass versions (#1493) (#1580)

* Be compatible to latest gopass versions.
`gopass show` is deprecated.

* add changelog fragment

* Update changelogs/fragments/1493-fix_passwordstore.py_to_be_compatible_with_gopass_versions.yml

Co-authored-by: Eike Waldt <git@yog.wtf>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 491b622041)

Co-authored-by: Eike Waldt <git@yeoldegrove.de>
This commit is contained in:
patchback[bot] 2021-01-03 11:48:37 +00:00 committed by GitHub
parent c413963ecb
commit b7a44a593e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- passwordstore lookup plugin - always use explicit ``show`` command to retrieve password. This ensures compatibility with ``gopass`` and avoids problems when password names equal ``pass`` commands (https://github.com/ansible-collections/community.general/pull/1493).

View file

@ -204,7 +204,7 @@ class LookupModule(LookupBase):
def check_pass(self): def check_pass(self):
try: try:
self.passoutput = to_text( self.passoutput = to_text(
check_output2(["pass", self.passname], env=self.env), check_output2(["pass", "show", self.passname], env=self.env),
errors='surrogate_or_strict' errors='surrogate_or_strict'
).splitlines() ).splitlines()
self.password = self.passoutput[0] self.password = self.passoutput[0]