also catch OSError from subprocess

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
remotes/origin/feature_files_export
Nico Schottelius 13 years ago
parent 88c1be4b1b
commit a9bcec7fbe
  1. 5
      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)

Loading…
Cancel
Save