diff options
Diffstat (limited to 'actions')
| -rw-r--r-- | actions/backup.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/actions/backup.py b/actions/backup.py index c5a60e2..ac7c4d9 100644 --- a/actions/backup.py +++ b/actions/backup.py @@ -1,3 +1,4 @@ +import shlex import subprocess import os try: @@ -14,7 +15,7 @@ def mkdir(dir): def execute(command, current_working_directory): return subprocess.check_output( - " ".join(command), + shlex.split(command), cwd=current_working_directory, ) @@ -38,7 +39,7 @@ def backup_command(cmd, args, dir): pass # Ignoring, the directory already exists except Exception, e: action_set({"directory creation exception": e}) - action_fail(e) + action_fail(str(e)) return command = cmd + " " + args @@ -50,7 +51,7 @@ def backup_command(cmd, args, dir): except subprocess.CalledProcessError, e: action_set({"error_code": e.returncode, "exception": e, "output": e.output}) - action_fail(e) + action_fail(str(e)) except Exception, e: action_set({"exception": e}) - action_fail(e) + action_fail(str(e)) |
