我不认为这是ncclient的问题,但我找不到关闭xml名称空间前缀标记的选项。
RPC客户端发送该RPC,
<?xml version="1.0" encoding="UTF-8"?> <nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:cdad1414-956b-47e7-8efc-fee92888475c"> <nc:get-config> <nc:source> <nc:running /> </nc:source> </nc:get-config> </nc:rpc>但是,我的设备(Ericsson Telecom Packet Core elements)不支持xml命名空间标签,并期望请求格式为:
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:cdad1414-956b-47e7-8efc-fee92888475c"> <get-config> <source> <running /> </source> </get-config> </rpc>如何关闭nc:?
发布于 2020-01-16 15:17:39
您必须贡献给ncclient,以便在operations/third_party下为ericsson添加代码。继承RPC类并重写_wrap函数来完成这项工作。
https://github.com/ncclient/ncclient/tree/master/ncclient/operations/third_party
https://github.com/ncclient/ncclient/blob/master/ncclient/operations/rpc.py#L309
https://stackoverflow.com/questions/57887532
复制相似问题