[YANGTOOLS-650] Some imports are not exposed in Module.getImports Created: 22/Aug/16  Updated: 10/Apr/22  Resolved: 21/Oct/16

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

Type: Bug
Reporter: Peter Verthez Assignee: Filip Gregor
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: 6491
Priority: Low

 Description   

If you have:

module A {
namespace ...;
prefix A;
// without revision element
...
}

module B {
namespace ...;
prefix B;
import A

{ prefix A; }

// also without revision-date
...
}

then the getImports() method on module B does not provide module A. It seems that this case is skipped over in AbstractEffectiveModule.resolveModuleImports().

I checked the RFC, and the situation seems legal, although it says:

  • on revision: "A module SHOULD have at least one initial "revision" statement."
  • on import: "If no "revision-date" substatement is present, it is undefined from which revision of the module they are taken."

But if there is only 1 revision of a module available, it seems logical to take that one.

Workaround is to add a revision to the imported module, then it works (and it's also the logical thing to do, to add the revision). So the severity of this bug is low.



 Comments   
Comment by Martin Ciglan [ 30/Aug/16 ]

Hi Peter

It is legal, but there seems to be some inconsistency in processing between actual module A revision, where in that case, default one is used AND import of this module A, where methods providing collection of imports skip it. Even though, priority of this bug is low, it's on radar of YT devs. Thanks.

Martin

Comment by Filip Gregor [ 20/Oct/16 ]

proposed solution https://git.opendaylight.org/gerrit/#/c/47129/

Comment by Robert Varga [ 21/Oct/16 ]

boron: https://git.opendaylight.org/gerrit/47317

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