[YANGTOOLS-1555] nested instance identifer values Created: 12/Dec/23 Updated: 12/Dec/23 Resolved: 12/Dec/23 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Medium |
| Reporter: | Maurizio Brigandi' | Assignee: | Unassigned |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
karaf 18.3 |
||
| Description |
|
The following instance-identifer value for node osiIf crosses a list element whose key my-is-is:name is an intance-identifer ... This following encoding seems reasonable as output of a GET, in which the single quote characters are escaped in the nested instance-idenfier value.
<osiIf xmlns:my-interfaces="xxx" xmlns:my-is-is="yyy" xmlns:my-routing="zzz">/my-routing:routing/my-routing:control-plane-protocol[my-routing:name='MANAGEMENT-PLANE']/my-is-is:isis/my-is-is:interface[my-is-is:name='/my-interfaces:interfaces/my-interfaces:if[my-interfaces:typeIf='lan'][my-interfaces:idx='1']']</osiIf>
But it is not accepted by opendaylight sw, which raises the following error: {
"errors": {
"error": [
{
"error-tag": "operation-failed",
"error-info": "java.lang.IllegalArgumentException: Could not parse Instance Identifier '/my-routing:routing/my-routing:control-plane-protocol[my-routing:name='MANAGEMENT-PLANE']/my-is-is:isis/my-is-is:interface[my-is-is:name='/my-interfaces:interfaces/my-interfaces:if[my-interfaces:typeIf='lan'][my-interfaces:idx='1']']'. Offset: 203 : Reason: Precondition must ends with ']'",
"error-message": "Transaction failed",
"error-type": "application"
}
]
}
}
|
| Comments |
| Comment by Robert Varga [ 12/Dec/23 ] |
|
This is not a bug. In order to make this case work, you need to use YANG string escaping, and since the embedded instance-identifier value uses single-quoted strings, the outer value needs to use double-quoted strings and escape the value using the rules associated with that. I.e. the value should be: /my-routing:routing/my-routing:control-plane-protocol[my-routing:name='MANAGEMENT-PLANE']/my-is-is:isis/my-is-is:interface[my-is-is:name="/my-interfaces:interfaces/my-interfaces:if[my-interfaces:typeIf='lan'][my-interfaces:idx='1']"] |