[YANGTOOLS-923] Opendaylight netconf parser removes namespaces in anyxml container before sending request to router Created: 29/Jun/18  Updated: 01/Jan/19  Resolved: 09/Dec/18

Status: Resolved
Project: yangtools
Component/s: codecs
Affects Version/s: 2.0.13, 2.1.4
Fix Version/s: 2.1.5, 2.0.14, 2.0.6.6

Type: Bug Priority: Medium
Reporter: Gregory Brown Assignee: Jakub Morvay
Resolution: Done Votes: 0
Labels: parser
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

java version "1.8.0_161"

Java(TM) SE Runtime Environment (build 1.8.0_161-b12)

Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

 

opendaylight-user*@*root>version

4.1.3


Attachments: File tailf-actions.yang    
Issue Links:
Duplicate
is duplicated by NETCONF-586 RPC ietf-netconf:edit-config removes ... Resolved
is duplicated by YANGTOOLS-864 XmlParserStream.readAnyXmlValue ignor... Resolved

 Description   

When sending the following restconf request to ODL, it looks like the parser is stripping off the second xmlns attribute.  

Post request: 

http://<ODL-Server>:8181/restconf/operations/network-topology:network-topology/topology/topology-netconf/node/<Device>/yang-ext:mount/tailf-actions:action/input/

<action xmlns="http://tail-f.com/ns/netconf/actions/1.0">
<data>
<hw-module xmlns="http://www.cisco.com/ns/yang/Cisco-IOS-XR-sysadmin-hw-module">
<oper>
<location>
<location>all</location>
<actions>
<reload/>
</actions>
</location>
</oper>
</hw-module>
</data>
</action>

 

When checking the ODL logs seeing it removes the second xmlns.

request: <rpc message-id="m-1408" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">

<action xmlns="http://tail-f.com/ns/netconf/actions/1.0">

<data>

    <hw-module>

      <oper>

        <location>

          <location>all</location>

          <actions>

            <reload/>

          </actions>

        </location>

      </oper>

    </hw-module>

  </data>

</action>

</rpc>

 

The following raw netconf-yang rpc works:

<rpc message-id="edcfd773-daac-4fdd-9867-053d4742d453" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <data>
    <hw-module xmlns="http://www.cisco.com/ns/yang/Cisco-IOS-XR-sysadmin-hw-module">
      <oper>
        <location>
          <location>all</location>
          <actions>
            <reload/>
          </actions>
        </location>
      </oper>
    </hw-module>
  </data>
</action>
</rpc> 

In the yang file the input rpc action is defined as:

 

  rpc action {

    description

      "Support Tail-F actions rpc format.";

 

    reference "RFC 6241, Section 7.1";

 

    input

Unknown macro: {       anyxml data Unknown macro}

    }



 Comments   
Comment by Jakub Morvay [ 05/Dec/18 ]

The problem here is that XmlParserStream (it is used by restconf internaly to parse xml into normalized nodes) strips attributes and namespaces when parsing AnyXml nodes.

Generated at Wed Feb 07 20:54:41 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.