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

Fix returnall for gopass (#5027) (#5029)

* Fix returnall for gopass

Gopass was always given the --password flag, despite there being no need for this.

* Add changelog fragment

Co-authored-by: Sylvia van Os <sylvia.van.os@politie.nl>
(cherry picked from commit 3eb29eb4b6)

Co-authored-by: Sylvia van Os <sylvia@hackerchick.me>
This commit is contained in:
patchback[bot] 2022-07-29 14:33:45 +02:00 committed by GitHub
parent 66cbd926f2
commit 3020b305bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 6 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- passwordstore lookup plugin - fix ``returnall`` for gopass (https://github.com/ansible-collections/community.general/pull/5027).

View file

@ -261,11 +261,11 @@ class LookupModule(LookupBase):
def is_real_pass(self):
if self.realpass is None:
try:
self.passoutput = to_text(
passoutput = to_text(
check_output2([self.pass_cmd, "--version"], env=self.env),
errors='surrogate_or_strict'
)
self.realpass = 'pass: the standard unix password manager' in self.passoutput
self.realpass = 'pass: the standard unix password manager' in passoutput
except (subprocess.CalledProcessError) as e:
raise AnsibleError(e)
@ -331,7 +331,6 @@ class LookupModule(LookupBase):
try:
self.passoutput = to_text(
check_output2([self.pass_cmd, 'show'] +
(['--password'] if self.backend == 'gopass' else []) +
[self.passname], env=self.env),
errors='surrogate_or_strict'
).splitlines()

View file

@ -318,9 +318,6 @@
if [ "$1" = "--version" ]; then
exit 2
fi
if [ "$1" = "show" ] && [ "$2" != "--password" ]; then
exit 3
fi
echo "gopass_ok"
dest: "{{ gopasspath }}"
mode: '0755'