[CONTROLLER-825] Invalid element order in generated Netconf message Created: 12/Sep/14  Updated: 25/Jul/23  Due: 16/Apr/15  Resolved: 10/Apr/15

Status: Resolved
Project: controller
Component/s: netconf
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Martin Volf Assignee: Tomas Cere
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Linux
Platform: PC


External issue ID: 1848

 Description   

The NETCONF messages sent to a device do not have elements in the RFC-required order. For instance, with the device data model containing this part

container root {
list policy {
key name;
leaf name

{ type string; }
list rule {
key name;
leaf name { type string; }

}
}
}

and a POST sent to http://localhost:8080/restconf/config/opendaylight-inventory:nodes/node/mexample/yang-ext:mount/ with data

<?xml version="1.0"?>
<dhex:root xmlns:dhex="http://acme.com/ns/example/dhcpd">
<dhex:policy>
<dhex:name>e</dhex:name>
<dhex:rule>
<dhex:name>rule-default</dhex:name>
</dhex:rule>
</dhex:policy>
</dhex:root>

this RPC is sent to the device:

<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-19">
<edit-config>
<target>
<candidate/>
</target>
<error-option>rollback-on-error</error-option>
<config>
<root xmlns="http://tail-f.com/ns/example/dhcpd">
<policy>
<rule>
<name>rule-default</name>
</rule>
<name>e</name>
</policy>
</root>
</config>
</edit-config>
</rpc>

But this is not valid, since the element "name" must be the first child of the element "policy", as required by RFC 6020.

Note that there is already fixed yangtools YANGTOOLS-282 but it does not seem to apply here.



 Comments   
Comment by RichardHill [ 12/Sep/14 ]

Also applies to PUT requests

Comment by Tony Tkacik [ 16/Sep/14 ]

remote: https://git.opendaylight.org/gerrit/11227

Comment by Maros Marsalek [ 27/Mar/15 ]

Reopening. This issue is present again in the codebase.

Comment by Tomas Cere [ 09/Apr/15 ]

https://git.opendaylight.org/gerrit/#/c/17997/

https://git.opendaylight.org/gerrit/#/c/17998/

Generated at Wed Feb 07 19:53:58 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.