From a9bcec7fbe9f4ca7ad901cfc3e14dc6a640640cc Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 18 Sep 2011 20:50:07 +0200 Subject: [PATCH] also catch OSError from subprocess Signed-off-by: Nico Schottelius --- bin/cdist | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/cdist b/bin/cdist index f7ad2f72..fce96099 100755 --- a/bin/cdist +++ b/bin/cdist @@ -198,6 +198,8 @@ class Cdist: script_fd.close() self.exit_error("Command failed (shell): " + " ".join(*args)) + except OSError as error: + self.exit_error(" ".join(*args) + ": " + error.args[1]) def run_or_fail(self, *args, **kargs): if "remote" in kargs: @@ -211,6 +213,9 @@ class Cdist: subprocess.check_call(*args, **kargs) except subprocess.CalledProcessError: self.exit_error("Command failed: " + " ".join(*args)) + except OSError as error: + self.exit_error(" ".join(*args) + ": " + error.args[1]) + def remove_remote_dir(self, destination): self.run_or_fail(["rm", "-rf", destination], remote=True)