[YANGTOOLS-618] Deviation statement is not fully available in the YANG parser output Created: 07/Jun/16  Updated: 10/Apr/22  Resolved: 25/Jul/16

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Peter Verthez Assignee: Igor Foltin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 6022

 Description   

Deviations are currently reported via the Deviation interface and can be retrieved from a Module via getDeviations().

However, not all information of the deviation can be retrieved.

For example, for the following deviation example from the RFC:

deviation /base:system/base:user/base:type {
deviate add

{ default "admin"; // new users are 'admin' by default }

}

the YANG parser returns a Deviation object, in which the getDeviate() method only returns an enum
NOT_SUPPORTED("not-supported"), ADD("add"), REPLACE("replace"), DELETE("delete")

The details for the deviation (in this example, that a default is added) are not available, so systems using the YANG parser cannot use this information.

So at the very minimum all the information from the deviation statement should be made available in the parser.

Would it however also be possible to transparently update the target nodes with the deviations? i.e. in the above example, the default value of the "type" DataSchemaNode could be transparently updated, so that applications don't have to process the deviations separately.

If I understand the YANG RFC correctly, a deviation is not automatically active: you have to announce via the hello capabilities that you are using certain deviations. So probably this should be done in the same way as in the if-feature case (https://bugs.opendaylight.org/show_bug.cgi?id=4506).



 Comments   
Comment by Igor Foltin [ 23/Jun/16 ]

fix pushed:

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

Comment by Peter Verthez [ 25/Jul/16 ]

So are the target nodes now transparently updated? I didn't see any discussion on that, and I would like to know what has been implemented.

Comment by Igor Foltin [ 25/Jul/16 ]

The patch above changed the deviation statement API so that it now provides more info about the deviation (for example, that a default is added, replaced etc). Moreover, the deviation statement now contains a list of deviate substatements instead of just one deviate.

Please, see this:

https://wiki.opendaylight.org/view/Weather#Change_of_deviation_statement_API_in_yangtools

The next step, i.e. updating deviation target node according to deviate(s)) will be addressed separately - https://bugs.opendaylight.org/show_bug.cgi?id=6261.

Comment by Peter Verthez [ 25/Jul/16 ]

OK, thanks.

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