Closed Joshua-M-CANARIE closed 1 year ago
Thanks for reporting. Issue reproduced for get_interfaces API call - XML sent:
<?xml version="1.0" encoding="UTF-8"?><nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:156fe603-eeb8-4071-a28e-fd833dc7bfa5"><nc:get><filter>
<state xmlns="urn:nokia.com:sros:ns:yang:sr:state">
<port>
<port-id/>
<oper-state/>
<hardware-mac-address/>
<ethernet>
<oper-speed/>
</ethernet>
</port>
<router>
<interface>
<oper-ip-mtu/>
<if-oper-status/>
<last-oper-change/>
</interface>
</router>
<chassis>
<hardware-data>
<base-mac-address/>
</hardware-data>
</chassis>
</state>
<configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf">
<port>
<port-id/>
<description/>
<ethernet>
<mtu/>
</ethernet>
<admin-state/>
</port>
<router>
<interface>
<admin-state/>
<description/>
<mac/>
<port/>
<loopback/>
</interface>
</router>
</configure>
</filter><ns0:with-defaults xmlns:ns0="urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults">report-all</ns0:with-defaults></nc:get></nc:rpc>
The SR OS server side (23.3.R1) complains about the 'filter' element:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply message-id="urn:uuid:156fe603-eeb8-4071-a28e-fd833dc7bfa5" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<rpc-error>
<error-type>protocol</error-type>
<error-tag>unknown-namespace</error-tag>
<error-severity>error</error-severity>
<error-message>
An unexpected namespace is present.
</error-message>
<error-info>
<bad-element>filter</bad-element>
<bad-namespace></bad-namespace>
</error-info>
</rpc-error>
</rpc-reply>
The same code does work with 22.10.R1
I've committed a fix which includes an explicit namespace in the \<filter> element, see e.g. https://github.com/napalm-automation-community/napalm-sros/blob/master/napalm_sros/nc_filters.py#L11
There may be additional updates required to the XML filters for newer SR OS releases, I'll have to do some further testing
Thank you very much with the change. Most functions do now work for 23.3.R1, there are some functions I'm still facing errors with though. Specifically, get_interfaces and get_bgp_neighbors. The get_interfaces function gets the following error:
Error in method get interfaces :
MINOR: MGMT_CORE #2201: Unknown element
Whereas get_bgp_neighbors gets the previously identified namespace error.
get_interfaces has an int-oper-status element that got renamed to oper-state; I need to find a good way to make it work for all releases
get_bgp_neighbors was refactored and has its \<filter> element in a different file; will update it shortly
Proposed fix: https://github.com/napalm-automation-community/napalm-sros/pull/65
Basically the root cause is that SR OS 23.3.R1 is more strict about XML namespaces, and the YANG model has changed slightly (one element under state got renamed)
I am trying to access information on our new NOKIA 7750 routers running SROS 23.3.R1 with napalm-sros and I'm running into a problem. Any function that calls XML parsing with the namespace returns the error "an unexpected namespace is present".
Here is my code (This code accesses Juniper and NOKIA equipment):
And this is the following output:
When I run show version on the device, I see this: