[YANGTOOLS-259] Having multiple revisions of the same YANG model causes build warnings/errors Created: 10/Aug/14  Updated: 10/Apr/22  Resolved: 25/Aug/14

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

Type: Bug
Reporter: Colin Dixon Assignee: Martin Vitez
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Mac OS
Platform: PC


Attachments: Text File controller-duplicate-yang.txt    
Issue Links:
Duplicate
is duplicated by YANGTOOLS-278 Please eliminate or turn down module ... Resolved
External issue ID: 1514

 Description   

I spent some time this weekend trying to root out all the warnings which building the TTP project, and I managed to get everything but this:

[INFO] yang-to-sources: Found 2 yang files in /Users/ckd/.m2/repository/org/opendaylight/controller/sal-core-spi/1.1-SNAPSHOT/sal-core-spi-1.1-SNAPSHOT.jar: [META-INF/yang/opendaylight-config-dom-datastore.yang, META-INF/yang/opendaylight-operational-dom-datastore.yang]
[WARNING] Error while sorting module [ietf-yang-types, Mon Jul 15 00:00:00 CDT 2013]: module with same namespace (urn:ietf:params:xml:ns:yang:ietf-yang-types) already loaded: [null, null]
[WARNING] Error while sorting module [ietf-yang-types, Mon Jul 15 00:00:00 CDT 2013]: module with same namespace (urn:ietf:params:xml:ns:yang:ietf-yang-types) already loaded: [null, null]
[WARNING] Error while sorting module [ietf-yang-types, Mon Jul 15 00:00:00 CDT 2013]: module with same namespace (urn:ietf:params:xml:ns:yang:ietf-yang-types) already loaded: [null, null]
[INFO] yang-to-sources: YANG files parsed from [META-INF/yang/ttp.yang]
[INFO] yang-to-sources: Code generator instantiated from org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl
[INFO] yang-to-sources: Sources will be generated to /Users/ckd/git-reps/ttp/ttp-model/src/main/yang-gen-sal
[WARNING] Error while sorting module [ietf-yang-types, Fri Sep 24 00:00:00 CDT 2010]: module with same namespace (urn:ietf:params:xml:ns:yang:ietf-yang-types) already loaded: [null, null]
[WARNING] Error while sorting module [ietf-yang-types, Fri Sep 24 00:00:00 CDT 2010]: module with same namespace (urn:ietf:params:xml:ns:yang:ietf-yang-types) already loaded: [null, null]

It seems like it stems from the fact that we have multiple versions of the same YANG module. Usually from the IETF models. I'm also attaching the many, many such warnings you get while building the controller.

I haven't spent enough time in the code to understand if there's a simple fix, but it seems like something that would be nice to have resolved for Helium.

The actual logged message seems to be coming from line 189 of yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/util/ModuleDependencySort.java in the yangtools project.



 Comments   
Comment by Colin Dixon [ 10/Aug/14 ]

Attachment controller-duplicate-yang.txt has been added with description: the warnings caused by this bug when building the controller

Comment by Martin Vitez [ 18/Aug/14 ]

Proposed patch:

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

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