Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-404

Can not import yang modul with explicit revision date: 1970-01-01

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Done
    • None
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    • 2649
    • Low

    Description

      The default yang module revision date is initialized as new Date(0); The returned date is dependent on current time zone and so default yang module revision is initialized now in SR as "Thu Jan 01 01:00:00 CET 1970" which is one hour after the imported yang module revision date "1970-01-01" and then imported yang module can not be resolved. Crucial is the line 322 in YangParserBaseListener.java.

      Parsing of following yang models:

      module foo {
      prefix foo;
      namespace "namespace-foo";

      import import-module

      { prefix imp; revision-date 1970-01-01; }

      }

      module import-module {
      prefix imp;
      namespace "import-module";

      revision 1970-01-01

      { description "Initial revision."; }

      }

      produce the following exception:

      Exception in thread "main" org.opendaylight.yangtools.yang.parser.util.YangValidationException: Not existing module imported:import-module:1970-01-01 by:foo:default
      at org.opendaylight.yangtools.yang.parser.util.ModuleDependencySort.ex(ModuleDependencySort.java:267)
      at org.opendaylight.yangtools.yang.parser.util.ModuleDependencySort.getModuleByNameAndRevision(ModuleDependencySort.java:257)
      at org.opendaylight.yangtools.yang.parser.util.ModuleDependencySort.processDependencies(ModuleDependencySort.java:217)
      at org.opendaylight.yangtools.yang.parser.util.ModuleDependencySort.createModuleGraph(ModuleDependencySort.java:148)
      at org.opendaylight.yangtools.yang.parser.util.ModuleDependencySort.sortInternal(ModuleDependencySort.java:131)
      at org.opendaylight.yangtools.yang.parser.util.ModuleDependencySort.sort(ModuleDependencySort.java:90)
      at org.opendaylight.yangtools.yang.parser.impl.YangParserImpl.parseYangModelSources(YangParserImpl.java:356)
      at org.opendaylight.yangtools.yang.parser.impl.YangParserImpl.parseYangModelsMapped(YangParserImpl.java:282)
      at org.opendaylight.yangtools.yang.parser.impl.YangParserImpl.parseFiles(YangParserImpl.java:159)

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            pkajsa Peter Kajsa
            pkajsa Peter Kajsa
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: