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

Issue parsing model which imports the same module twice with different prefixes.

    XMLWordPrintable

Details

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

    • 6249

    Description

      ODL is unable to NETCONF mount an IOS-XR device which exposes a YANG model which has 2 imports of the same module, but with different prefixes. The error occurs when attempting to reference that module:

      2016-07-21 16:43:34,488 | ERROR | sing-executor-12 | NetconfDevice | 156 - org.opendaylight.netconf.sal-netconf-connector - 1.3.2.Beryllium-SR2 | RemoteDevice

      {XR9KV}

      : Initialization in sal failed, disconnecting from device
      java.lang.IllegalArgumentException: Failed to parse node 'node:active-nodes' in path '/node:active-nodes/node:active-node'
      at org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils.nodeIdentifierFromPath(Utils.java:414)[51:org.opendaylight.yangtools.yang-parser-impl:0.8.2.Beryllium-SR2]
      at org.opendaylight.yangtools.yang.parser.stmt.rfc6020.AugmentStatementImpl$Definition.parseArgumentValue(AugmentStatementImpl.java:75)[51:org.opendaylight.yangtools.yang-parser-impl:0.8.2.Beryllium-SR2]
      at org.opendaylight.yangtools.yang.parser.stmt.rfc6020.AugmentStatementImpl$Definition.parseArgumentValue(AugmentStatementImpl.java:62)[51:org.opendaylight.yangtools.yang-parser-impl:0.8.2.Beryllium-SR2]
      at org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementDefinitionContext.parseArgumentValue(StatementDefinitionContext.java:34)[51:org.opendaylight.yangtools.yang-parser-impl:0.8.2.Beryllium-SR2]
      at org.opendaylight.yangtools.yang.parser.stmt.reactor.SubstatementContext.<init>(SubstatementContext.java:49)[51:org.opendaylight.yangtools.yang-parser-impl:0.8.2.Beryllium-SR2]
      at org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementContextBase$1.build(StatementContextBase.java:327)[51:org.opendaylight.yangtools.yang-parser-impl:0.8.2.Beryllium-SR2]
      at org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementContextWriter.defferedCreate(StatementContextWriter.java:45)[51:org.opendaylight.yangtools.yang-parser-impl:0.8.2.Beryllium-SR2]
      at org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementContextWriter.startStatement(StatementContextWriter.java:32)[51:org.opendaylight.yangtools.yang-parser-impl:0.8.2.Beryllium-SR2]
      at org.opendaylight.yangtools.yang.parser.impl.YangStatementParserListenerImpl.enterStatement(YangStatementParserListenerImpl.java:82)[51:org.opendaylight.yangtools.yang-parser-impl:0.8.2.Beryllium-SR2]
      at org.opendaylight.yangtools.antlrv4.code.gen.YangStatementParser$StatementContext.enterRule(YangStatementParser.java:113)[51:org.opendaylight.yangtools.yang-parser-impl:0.8.2.Beryllium-SR2]
      ...

      The current workaround is:

      (1) attempt to mount the device using RESTCONF. This will fail.
      (2) go into the “cache/schema” directory under distribution-karaf-0.4.2-beryllium-SR2
      (3) edit the file “Cisco-IOS-XR-watchd-cfg@2015-11-09”.
      (4) delete the line " import Cisco-IOS-XR-config-mda-cfg

      { prefix "a1"; }


      (5) unmount the device using RESTCONF.
      (6) re-mount the device using RESTCONF. This time it should succeed.

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              giheron@cisco.com Giles Heron
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: