Update remote.py according to new exec_util api.
This commit is contained in:
parent
ca4cb07b16
commit
f6ea90c3a5
1 changed files with 4 additions and 5 deletions
|
@ -168,14 +168,13 @@ class Remote(object):
|
||||||
|
|
||||||
self.log.debug("Remote run: %s", command)
|
self.log.debug("Remote run: %s", command)
|
||||||
try:
|
try:
|
||||||
output = exec_util.call_get_output(command, env=os_environ)
|
output, errout = exec_util.call_get_output(command, env=os_environ)
|
||||||
self.log.debug("Remote output: {}".format(output))
|
self.log.debug("Remote stdout: {}".format(output))
|
||||||
|
self.log.debug("Remote stderr: {}".format(errout))
|
||||||
if return_output:
|
if return_output:
|
||||||
return output.decode()
|
return output.decode()
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
raise cdist.Error("Command failed: " + " ".join(command)
|
exec_util.handle_called_process_error(e, command)
|
||||||
+ " with returncode: {} and output: {}".format(
|
|
||||||
e.returncode, e.output))
|
|
||||||
except OSError as error:
|
except OSError as error:
|
||||||
raise cdist.Error(" ".join(command) + ": " + error.args[1])
|
raise cdist.Error(" ".join(command) + ": " + error.args[1])
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
|
|
Loading…
Reference in a new issue