From 72b5e19ffe941278c6f2d3f174585b813d0f6758 Mon Sep 17 00:00:00 2001 From: bom Date: Fri, 19 May 2023 13:56:43 +0200 Subject: [PATCH] Include shell parameter in ExecutionApi --- .../python/ddadevops/infrastructure/infrastructure.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index 54932db..b41e890 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -90,14 +90,13 @@ class ImageApi: class ExecutionApi: - def execute(self, command: str, dry_run=False): + def execute(self, command: str, dry_run=False, shell=True): output = "" if dry_run: print(command) else: - output = check_output(command, encoding="UTF-8", shell=True) + output = check_output(command, encoding="UTF-8", shell=shell) output = output.rstrip() - print(output) return output def execute_live(command): @@ -121,7 +120,7 @@ class CredentialsApi: credential = None if path and field: print("get field for: " + path + ", " + field) - credential = self.execution_api.execute(["gopass", "show", path, field]) + credential = self.execution_api.execute(["gopass", "show", path, field], shell=False) return credential def gopass_password_from_path(self, path): @@ -129,7 +128,7 @@ class CredentialsApi: if path: print("get password for: " + path) credential = self.execution_api.execute( - ["gopass", "show", "--password", path] + ["gopass", "show", "--password", path], shell=False ) return credential