def exec_command(self, cmd, in_data='', sudoable=True, mitogen_chdir=None):
        """
        Implement exec_command() by calling the corresponding
        ansible_mitogen.target function in the target.

        :param str cmd:
            Shell command to execute.
        :param bytes in_data:
            Data to supply on ``stdin`` of the process.
        :returns:
            (return code, stdout bytes, stderr bytes)
        """
        emulate_tty = (not in_data and sudoable)
        rc, stdout, stderr = self.get_chain().call(
            ansible_mitogen.target.exec_command,
            cmd=mitogen.utils.cast(cmd),
            in_data=mitogen.utils.cast(in_data),
            chdir=mitogen_chdir or self.get_default_cwd(),
            emulate_tty=emulate_tty,
        )

        stderr += b'Shared connection to %s closed.%s' % (
            self._play_context.remote_addr.encode(),
            (b'\r\n' if emulate_tty else b'\n'),
        )
        return rc, stdout, stderr
def exec_command ( self , cmd , in_data = '' , sudoable = True , mitogen_chdir = None ) : emulate_tty = ( not in_data and sudoable ) rc , stdout , stderr = self . get_chain ( ) . call ( ansible_mitogen . target . exec_command , cmd = mitogen . utils . cast ( cmd ) , in_data = mitogen . utils . cast ( in_data ) , chdir = mitogen_chdir or self . get_default_cwd ( ) , emulate_tty = emulate_tty , ) stderr += b'Shared connection to %s closed.%s' % ( self . _play_context . remote_addr . encode ( ) , ( b'\r\n' if emulate_tty else b'\n' ) , ) return rc , stdout , stderr
Implement exec_command() by calling the corresponding
        ansible_mitogen.target function in the target.

        :param str cmd:
            Shell command to execute.
        :param bytes in_data:
            Data to supply on ``stdin`` of the process.
        :returns:
            (return code, stdout bytes, stderr bytes)