[CONTROLLER-256] Loading YANG files from local directory when netconf server does not support netconf monitoring Created: 01/Apr/14 Updated: 25/Jul/23 Resolved: 03/Nov/14 |
|
| Status: | Resolved |
| Project: | controller |
| Component/s: | netconf |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | ||
| Reporter: | Kanika Gupta | Assignee: | Maros Marsalek |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: Windows |
||
| Description |
|
I have a netconf server that does not advertise any YANG files. As a result of which NetConfDevice.getInitialCapabilities() sets cachedCapabilities as [] since none of the capability has module, revision and "?" & hence FilesystemSchemaCachingProvider never loads any files from cache/schema. IMHO it is critical since for any netconf device that doesn't support ietf monitoring, neconf southbound plugin would not be able to read the YANG model and therefore device information can not be accessed using RESTCONF. Note: As a workaround, I have hard coded the server capabilities in odl's code to advertise the YANG files I have written to represent my device. I have put these YANG files in below location: |
| Comments |
| Comment by Tony Tkacik [ 02/Apr/14 ] |
|
Changed to enhancement, since this is new feature. |
| Comment by Kanika Gupta [ 02/Apr/14 ] |
|
Thanks Tony for having a look at it. Would it be right to load the yang files from local directory or should the yang files be written in a separate osgi bundle. Also, if we put the yang files in local directory, there will be no java source code generated - so in that case how to manipulate the device data? -Kanika |
| Comment by Kanika Gupta [ 07/Apr/14 ] |
|
Hi Tony, Is it possible to reference the yang files from OSGI bundle when netconf server doesn't support ietf monitoring. Because now i have to keep two copies of yang files: 1) OSGI bundle -Kanika |
| Comment by Kanika Gupta [ 24/Jun/14 ] |
|
. I have a netconf server which does not support netconf monitoring and therefore no yang files are loaded from the device. So I wrote my own yang file that represent the device and below is what I hard coded. With recent refactoring done in this area, you might not find NetconfDevice.xtend, please look for NetconfDevice.java. 1. Placed 03-neconf-devices.xml in initial directory, updated netconf server ip, port, password, name. Started the controller and was able to see the netconf servers in opendaylight inventory (http://localhost:8080/restconf/operational/opendaylight-inventory:nodes/) o Update getInitialCapabilities() method as below |
| Comment by Ankit agarwal [ 17/Jul/14 ] |
|
https://git.opendaylight.org/gerrit/#/c/9107/ https://git.opendaylight.org/gerrit/#/c/9107/ I have fixed the code to read the schema file from ODL local. |
| Comment by Ankit agarwal [ 18/Jul/14 ] |
|
Hi I have fixed the ODL code and below mentioned gerrit code can be used for fixing the issue: changes in MD-SAL: https://git.opendaylight.org/gerrit/#/c/9135 changes in yangtools: https://git.opendaylight.org/gerrit/#/c/9112/ |
| Comment by Maros Marsalek [ 18/Jul/14 ] |
|
(In reply to Ankit agarwal from comment #6) Hi Your commits do not solve the problem reported here. This problem says that if you put yang files into local folder for a device that does not report its modules, there is no way for netconf-connector to load them. There needs to be a mechanism to tell netconf-connector about schemas in /cache/schema folder. You are possibly solving a problem with device reporting yang modules but without revision. Is that correct ? If so, please report a new bug and put your commits there. Maros |
| Comment by Ankit agarwal [ 21/Jul/14 ] |
|
Raised a new Bug - 1393 as suggested |
| Comment by Maros Marsalek [ 31/Jul/14 ] |
| Comment by Rahul Swaminathan [ 03/Nov/14 ] |
|
Hi Maros/Kanika, I checked the above commit message https://git.opendaylight.org/gerrit/#/c/9490/ and it says "User can place yang files into cache/schema folder and set the capabilities for these modules into config attribute for netconf-connector." I'm using the ODL's Service Provider Ubuntu VM in my testing. I've added my YANG file in controller-sp/opendaylight/cache/schema. But, I'm unable find the file where I've to add the capabilities. Regards, |