From c1ad93bccc6cf93b3a5129914624ec3350ca9b14 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 9 Sep 2011 14:27:54 +0200 Subject: [PATCH] extend run_or_fail to include remote exec Signed-off-by: Nico Schottelius --- bin/cdist | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/bin/cdist b/bin/cdist index 0772c703..5227dc06 100755 --- a/bin/cdist +++ b/bin/cdist @@ -155,20 +155,14 @@ class Cdist: self.exit_error("Non-Zero exit code exit of " + " ".join(*args)) def run_or_fail(self, *args, **kargs): - log.debug("Exec: " + " ".join(*args)) - if "remote" in kargs: log.debug("Remote found") if kargs["remote"]: - # Replace the list found in the tuple at position 0 - cmd = ["ssh", "root@" + self.target_host] - cmd.extend(args[0]) - args[0] = cmd - print(newargs) + args[0][:0] = ["ssh", "root@" + self.target_host] del kargs["remote"] - log.debug(newargs) + log.debug("Exec: " + " ".join(*args)) try: subprocess.check_call(*args, **kargs) except subprocess.CalledProcessError: