From 039f1940a0f8ae9b66ce656a43e9d44f3e943eda Mon Sep 17 00:00:00 2001 From: Markus Luisser <10373572+cargocultprogramming@users.noreply.github.com> Date: Thu, 26 Jan 2023 12:08:04 +0100 Subject: [PATCH] fix: omit subprocess return code check This avoids running into an Exception when bw (tested with bw 2023.1.0) returns a non-zero exit code while checking if a bw session already exists. --- bw_add_sshkeys.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bw_add_sshkeys.py b/bw_add_sshkeys.py index 8d10258..b49cd97 100755 --- a/bw_add_sshkeys.py +++ b/bw_add_sshkeys.py @@ -68,7 +68,7 @@ def get_session(session: str) -> str: return session # Check if we're already logged in - proc_logged = subprocess.run(["bw", "login", "--check", "--quiet"], check=True) + proc_logged = subprocess.run(["bw", "login", "--check", "--quiet"], check=False) if proc_logged.returncode: logging.debug("Not logged into Bitwarden")