'Sends the request to the node and returns the reply
The method accepts two forms of request.  The first form is as a byte
string that represents xml string be send over netconf session.
The second form is a json-rpc (2.0) byte string.'

@ensure_connect
def exec_command(self, request):

    try:
        obj = json.loads(to_text(request, errors='surrogate_or_strict'))
        if ('jsonrpc' in obj):
            if self._netconf:
                out = self._exec_rpc(obj)
            else:
                out = self.internal_error(('netconf    plugin    is    not    supported    for    network_os    %s' % self._play_context.network_os))
            return (0, to_bytes(out, errors='surrogate_or_strict'), '')
        else:
            err = self.invalid_request(obj)
            return (1, '', to_bytes(err, errors='surrogate_or_strict'))
    except (ValueError, TypeError):
        request = to_native(request, errors='surrogate_or_strict')
    req = to_ele(request)
    if (req is None):
        return (1, '', 'unable    to    parse    request')
    try:
        reply = self._manager.rpc(req)
    except RPCError as exc:
        return (1, '', to_bytes(to_xml(exc.xml), errors='surrogate_or_strict'))
    return (0, to_bytes(reply.data_xml, errors='surrogate_or_strict'), '')
