[YANGTOOLS-889] Using wrong prefix on augmentation not caught Created: 03/Jul/18  Updated: 31/Jul/18  Resolved: 10/Jul/18

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: 2.0.7
Fix Version/s: 2.0.8, 2.0.6.1

Type: Bug Priority: Medium
Reporter: Claudio David Gasparini Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

given 

 

import openconfig-bgp-policy { prefix bgppol; }

and using

 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgp-pol:bgp-actions {

 

Notice bgpol != bgp-pol

won't produce any error or complain. Whether this doesn't seems to have any negative impact,

it should be addressed correctly.

Code Example

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



 Comments   
Comment by Claudio David Gasparini [ 03/Jul/18 ]

No issue is observed, but I would expect an alert or error when using wrong prefix.

Comment by Robert Varga [ 09/Jul/18 ]

This boils down to SourceSpecificContext.getFromLocalStorage() looking also into imported modules' storage – and finding a match provided by openconfig-bgp-policy.yang's prefix statement. That is wrong and seems to contradict the intended behavior of the ImportPrefixToModuleCtx.

Comment by Robert Varga [ 09/Jul/18 ]

As it turns out the namespace behaviour of ImportPrefixToModuleCtx is wrong, as it should not be NamespaceBehaviour.sourceSpecific(), but limited to root statement.

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