Update remote.py according to new exec_util api.

This commit is contained in:
Darko Poljak 2016-06-24 11:18:24 +02:00
parent ca4cb07b16
commit f6ea90c3a5

View file

@ -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: