From d2087a441e9d559cb032f261a1bf22003590c437 Mon Sep 17 00:00:00 2001 From: p4u1 Date: Sat, 11 Nov 2023 08:54:00 +0100 Subject: [PATCH] fix removing quotes --- backupbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backupbot.py b/backupbot.py index 077cd6b..1ffc739 100755 --- a/backupbot.py +++ b/backupbot.py @@ -139,7 +139,7 @@ def run_commands(commands): command = command.removeprefix('bash -c').removeprefix('sh -c') # Remove quotes surrounding the command if (len(command) >= 2 and command[0] == command[-1] and (command[0] == "'" or command[0] == '"')): - command[1:-1] + command = command[1:-1] # Use bash's pipefail to return exit codes inside a pipe to prevent silent failure command = f"bash -c 'set -o pipefail;{command}'" logging.info(f"run command in {container.name}:")