From 8f4db351e13542b7498f1a1380be03bb303893af Mon Sep 17 00:00:00 2001 From: Anael Beutot Date: Fri, 25 May 2012 17:09:44 +0200 Subject: [PATCH] Log exception when doing a remote execution. --- ccnode/host/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ccnode/host/__init__.py b/ccnode/host/__init__.py index ff36df9..9ee1d36 100644 --- a/ccnode/host/__init__.py +++ b/ccnode/host/__init__.py @@ -52,8 +52,12 @@ class Handler(BasePlugin): :param string command: shell command to run """ # return stdout and stderr mixed in - return Popen(command, shell=True, bufsize=-1, stdin=PIPE, stdout=PIPE, - stderr=STDOUT).communicate()[0] or None + try: + return Popen(command, shell=True, bufsize=-1, stdin=PIPE, stdout=PIPE, + 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): """Halt/Reboot the node. -- GitLab