From 1fc53eea22738c5b0df077cf9112bc6d0cadac68 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Wed, 22 Feb 2023 16:43:55 +0100 Subject: [PATCH] [PR #5942/5648e0e2 backport][stable-6] onepassword: ignore errors from "op account get" (#6037) onepassword: ignore errors from "op account get" (#5942) * ignore errors from "op account get" * add changelog fragment * Update changelogs/fragments/5942-onepassword-ignore-errors-from-op-account-get.yml Co-authored-by: Felix Fontein --------- Co-authored-by: Felix Fontein (cherry picked from commit 5648e0e2aff5ac1c677dc9047c332498d595dc45) Co-authored-by: Glenn Marcy --- .../5942-onepassword-ignore-errors-from-op-account-get.yml | 2 ++ plugins/lookup/onepassword.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/5942-onepassword-ignore-errors-from-op-account-get.yml diff --git a/changelogs/fragments/5942-onepassword-ignore-errors-from-op-account-get.yml b/changelogs/fragments/5942-onepassword-ignore-errors-from-op-account-get.yml new file mode 100644 index 0000000000..e6b774dd35 --- /dev/null +++ b/changelogs/fragments/5942-onepassword-ignore-errors-from-op-account-get.yml @@ -0,0 +1,2 @@ +bugfixes: +- onepassword lookup plugin - Changed to ignore errors from "op account get" calls. Previously, errors would prevent auto-signin code from executing (https://github.com/ansible-collections/community.general/pull/5942). diff --git a/plugins/lookup/onepassword.py b/plugins/lookup/onepassword.py index 5e9549c2b7..0e78e4b1a0 100644 --- a/plugins/lookup/onepassword.py +++ b/plugins/lookup/onepassword.py @@ -488,7 +488,7 @@ class OnePassCLIv2(OnePassCLIBase): account = "{subdomain}.{domain}".format(subdomain=self.subdomain, domain=self.domain) args.extend(["--account", account]) - rc, out, err = self._run(args) + rc, out, err = self._run(args, ignore_errors=True) return not bool(rc)