From f6ea90c3a50f757871504675084c8da70ca76097 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Fri, 24 Jun 2016 11:18:24 +0200 Subject: [PATCH] Update remote.py according to new exec_util api. --- cdist/exec/remote.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cdist/exec/remote.py b/cdist/exec/remote.py index c78f02cb..0331f402 100644 --- a/cdist/exec/remote.py +++ b/cdist/exec/remote.py @@ -168,14 +168,13 @@ class Remote(object): self.log.debug("Remote run: %s", command) try: - output = exec_util.call_get_output(command, env=os_environ) - self.log.debug("Remote output: {}".format(output)) + output, errout = exec_util.call_get_output(command, env=os_environ) + self.log.debug("Remote stdout: {}".format(output)) + self.log.debug("Remote stderr: {}".format(errout)) if return_output: return output.decode() except subprocess.CalledProcessError as e: - raise cdist.Error("Command failed: " + " ".join(command) - + " with returncode: {} and output: {}".format( - e.returncode, e.output)) + exec_util.handle_called_process_error(e, command) except OSError as error: raise cdist.Error(" ".join(command) + ": " + error.args[1]) except UnicodeDecodeError: