Commit 8f4db351 authored by Anael Beutot's avatar Anael Beutot
Browse files

Log exception when doing a remote execution.

parent 3f80f0a0
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -52,8 +52,12 @@ class Handler(BasePlugin):
        :param string command: shell command to run
        """
        # return stdout and stderr mixed in
        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.