From 682f77e9b8719d7b4f15395fac66c25d20f210c2 Mon Sep 17 00:00:00 2001 From: Tobias Trabelsi Date: Sat, 24 Jun 2023 18:31:00 +0200 Subject: [PATCH] fix bw installation -.- Fixes #29 --- Dockerfile | 4 +++- src/utils/utils.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 64cd5f3..0df6dbf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ LABEL org.opencontainers.image.source=https://github.com/Lerentis/bitwarden-crd- LABEL org.opencontainers.image.description="Kubernetes Operator to create k8s secrets from bitwarden" LABEL org.opencontainers.image.licenses=MIT -ARG PYTHON_VERSION=3.11.3-r11 +ARG PYTHON_VERSION=3.11.4-r0 ARG PIP_VERSION=23.1.2-r0 ARG GCOMPAT_VERSION=1.1.0-r1 ARG LIBCRYPTO_VERSION=3.1.0-r4 @@ -24,6 +24,8 @@ RUN set -eux; \ cd /tmp; \ wget https://github.com/bitwarden/clients/releases/download/cli-v${BW_VERSION}/bw-linux-${BW_VERSION}.zip; \ unzip /tmp/bw-linux-${BW_VERSION}.zip; \ + mv /tmp/bw /usr/local/bin/bw; \ + chmod +x /usr/local/bin/bw; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/src/utils/utils.py b/src/utils/utils.py index f18adf7..630dc9d 100644 --- a/src/utils/utils.py +++ b/src/utils/utils.py @@ -32,9 +32,9 @@ def command_wrapper(logger, command, use_success: bool = True): shell=True, env=system_env) out, err = sp.communicate() - resp = json.loads(out.decode(encoding='UTF-8')) if "DEBUG" in system_env: - logger.info(resp) + logger.info(out.decode(encoding='UTF-8')) + resp = json.loads(out.decode(encoding='UTF-8')) if resp["success"] != None and (not use_success or (use_success and resp["success"] == True)): return resp logger.warn(resp)