Beispiel #1
0
    def extract_sandesh_header(sandesh_xml):
        transport = TTransport.TMemoryBuffer(sandesh_xml)
        protocol_factory = TXMLProtocol.TXMLProtocolFactory()
        protocol = protocol_factory.getProtocol(transport)

        from gen_py.sandesh.ttypes import SandeshHeader
        hdr = SandeshHeader()
        hdr_len = hdr.read(protocol)
        if hdr_len == -1:
            return (None, 0, None)
        # Extract the sandesh name
        (length, sandesh_name) = protocol.readSandeshBegin()
        if length == -1:
            return (hdr, hdr_len, None)
        return (hdr, hdr_len, sandesh_name)
Beispiel #2
0
    def extract_sandesh_header(sandesh_xml):
        transport = TTransport.TMemoryBuffer(sandesh_xml)
        protocol_factory = TXMLProtocol.TXMLProtocolFactory()
        protocol = protocol_factory.getProtocol(transport)

        from gen_py.sandesh.ttypes import SandeshHeader
        hdr = SandeshHeader()
        hdr_len = hdr.read(protocol)
        if hdr_len == -1:
            return (None, 0, None)
        # Extract the sandesh name
        (length, sandesh_name) = protocol.readSandeshBegin()
        if length == -1:
            return (hdr, hdr_len, None)
        return (hdr, hdr_len, sandesh_name)