Skip to content
Snippets Groups Projects
Commit 8f4db351 authored by Anael Beutot's avatar Anael Beutot
Browse files

Log exception when doing a remote execution.

parent 3f80f0a0
No related branches found
No related tags found
No related merge requests found
...@@ -52,8 +52,12 @@ class Handler(BasePlugin): ...@@ -52,8 +52,12 @@ class Handler(BasePlugin):
:param string command: shell command to run :param string command: shell command to run
""" """
# return stdout and stderr mixed in # return stdout and stderr mixed in
try:
return Popen(command, shell=True, bufsize=-1, stdin=PIPE, stdout=PIPE, return Popen(command, shell=True, bufsize=-1, stdin=PIPE, stdout=PIPE,
stderr=STDOUT).communicate()[0] or None stderr=STDOUT).communicate()[0] or None
except Exception:
logger.exception('Error while executing a remote command')
raise
def node_shutdown(self, reboot=True, gracefull=True): def node_shutdown(self, reboot=True, gracefull=True):
"""Halt/Reboot the node. """Halt/Reboot the node.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment