[CONTROLLER-1494] Fails to inject config module with no list dependency entry Created: 01/Mar/16 Updated: 25/Jul/23 Resolved: 20/Apr/16 |
|
| Status: | Resolved |
| Project: | controller |
| Component/s: | config |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Milos Fabian | Assignee: | Andrej Mak |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| Issue Links: |
|
||||||||
| External issue ID: | 5444 | ||||||||
| Description |
|
Steps to reproduce: 2016-03-01 11:00:24,011 | ERROR | entLoopGroup-6-2 | NetconfOperationRouterImpl | 285 - org.opendaylight.netconf.impl - 1.1.0.SNAPSHOT | Unexpected exception during netconf operation execution The system complains about missing (null) "add-path" attribute. The "add-path" is defined in odl-bgp-rib-rib-impl-cfg.yang as } The input XML does not contain any entry with add-path dependency. When the same module is defined in initial config xml file - it works. |
| Comments |
| Comment by Kangqian Yin [ 07/Apr/16 ] |
|
Did you specify value of "replace" in "default-operation" attribute of "edit-config" tag in your netconf message to configure example-bgp-peer module? I've tested that if "merge" specifed, such netconf message in https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Peer_2 can be commited correctly. If "replace" specified, such netconf message will yield similar errors as you encounterd. RFC6241 definitely says that "merge" is the default behaviour in Section 7.2. So odl config subsystem pushes xml config file in merge strategy. That's why such netconf messages in 41-bgp-example.xml can be pushed correctly. |
| Comment by Vratko Polak [ 07/Apr/16 ] |
|
As far as I know, using RESTCONF via netconf-connector picks operation based on HTTP method. POST means create, PUT means replace, and I guess merge can be achieved using PATCH. |
| Comment by Kangqian Yin [ 08/Apr/16 ] |
|
Just as Vratko said, POST means create, PUT means replace. So when I tried to POST or PUT a new value to an attribute of an existing module through RESTCONF, both failed. When I tried to PATCH, ODL controller complained as following: < HTTP/1.1 405 Method Not Allowed Since PUT means replace, then I wanted to PUT new value to RESTCONF URI of the node of the attribute of the module, it still failed because the attribute node is a Leaf yang type. Current ODL netconf operations only support to PUT a node of Container or List yang type. Summing up my experiments, I haven't found a convenient way to assign new value to a leaf node attribute of an existing module. If it's true for ODL, we need to add a such way. |
| Comment by Kangqian Yin [ 08/Apr/16 ] |
|
(In reply to Kangqian Yin from comment #3) It's more accurate to say that current ODL netconf server only supports to PUT a node of Container or List yang type through RESTCONF. And there is a convenient way to assign new value to a leaf node attribute of an existing module through netconf messages issued by sucn netconf client as Netconf Browser. It seems lacking of such way through RESTCONF in ODL. |
| Comment by Vratko Polak [ 08/Apr/16 ] |
|
< Allow: POST,GET,DELETE,OPTIONS,HEAD,PUT Which version of ODL are you using? I believe PATCH is supported since Beryllium-SR1. > only supports to PUT a node of Container or List yang type through RESTCONF. True for RESTCONF as far as I know. > current ODL netconf server only supports to PUT a node of Container or List yang type ODL contains two netconf servers. One for config subsystem (relevant for this Bug) and one for MD-SAL (not relevant here). |
| Comment by Kangqian Yin [ 11/Apr/16 ] |
|
(In reply to Vratko Polák from comment #5) >> My experiments were done with Li-SR4 version of ODL. And I've just tried the master branch version of ODL and got the same result. It's because Jetty server is still 8.1.5.v20140411 in current version of ODL as in Li-SR4. |
| Comment by Andrej Mak [ 12/Apr/16 ] |
|
Empty list allowed by patch However, module odl-bgp-rib-impl-cfg.yang is not valid. |
| Comment by Milos Fabian [ 12/Apr/16 ] |
|
(In reply to Andrej Mak from comment #7) Good point, thanks Andrej! |
| Comment by Kangqian Yin [ 19/Apr/16 ] |
|
Let me explain Andrej's fixing. Andrej just modified a few lines in TemplateFactory.java which is part of yang-jmx-generator plugin. The key to understand this is in the attribute setters of AbstractXXXModule Current setter of a list node attribute is like the following: public void setLocalTable(java.util.List<javax.management.ObjectName> localTable) { Andrej's fixing changed it to be somehow like this: public void setLocalTable(java.util.List<javax.management.ObjectName> localTable) { ; So new attributes of a module with empty lists can be set and merged with current attributes of a module successfully. |