Loading cloudcontrol/node/host/__init__.py +5 −3 Original line number Diff line number Diff line Loading @@ -278,16 +278,18 @@ class Handler(BasePlugin): logger.debug('Plugins state saved') @rpc_handler def execute_command(self, command): def execute_command(self, command, stdin=None): """Execute an arbitrary shell command on the host. :param string command: shell command to run :param string stdin: string to use as stdin on command """ logger.debug('Executing command %s', command) try: remote_command = EvPopen(self.main, command, close_fds=True, shell=True, stdout=PIPE, stderr=STDOUT) shell=True, stdout=PIPE, stdin=PIPE, stderr=STDOUT) except Exception: logger.exception('Error while starting subprocess for executing ' ' command %s', command) Loading @@ -296,7 +298,7 @@ class Handler(BasePlugin): self.commands.add(remote_command) try: stdout, _ = remote_command.communicate() stdout, _ = remote_command.communicate(stdin) except Exception: logger.exception('Error while communicating with subprocess for' ' command %s', command) Loading Loading
cloudcontrol/node/host/__init__.py +5 −3 Original line number Diff line number Diff line Loading @@ -278,16 +278,18 @@ class Handler(BasePlugin): logger.debug('Plugins state saved') @rpc_handler def execute_command(self, command): def execute_command(self, command, stdin=None): """Execute an arbitrary shell command on the host. :param string command: shell command to run :param string stdin: string to use as stdin on command """ logger.debug('Executing command %s', command) try: remote_command = EvPopen(self.main, command, close_fds=True, shell=True, stdout=PIPE, stderr=STDOUT) shell=True, stdout=PIPE, stdin=PIPE, stderr=STDOUT) except Exception: logger.exception('Error while starting subprocess for executing ' ' command %s', command) Loading @@ -296,7 +298,7 @@ class Handler(BasePlugin): self.commands.add(remote_command) try: stdout, _ = remote_command.communicate() stdout, _ = remote_command.communicate(stdin) except Exception: logger.exception('Error while communicating with subprocess for' ' command %s', command) Loading