From 99268591c2e3eddbc49bb95f5b2fa31b7f8bd42f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 9 Sep 2011 20:54:17 +0200 Subject: [PATCH] make more use of run_or_fail Signed-off-by: Nico Schottelius --- bin/cdist | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/bin/cdist b/bin/cdist index 30af2827..72b7a752 100755 --- a/bin/cdist +++ b/bin/cdist @@ -139,18 +139,13 @@ class Cdist: log.error(*args) sys.exit(1) - def remote_mkdir(directory): + def remote_mkdir(self, directory): """Create directory on remote side""" self.run_or_fail(["mkdir", "-p", directory], remote=True) def remote_cat(filename): - cmd = self.remote_prefix - cmd.append("cat") - cmd.append(filename) - try: - subprocess.call(cmd) - except subprocess.CalledProcessError: - log.error("Remote cat failed") + """Use cat on the remote side for output""" + self.run_or_fail(["cat", filename], remote=True) def shell_run_or_debug_fail(self, script, *args, **kargs): # Manually execute /bin/sh, because sh -e does what we want