Uploaded image for project: 'ONOS'
  1. ONOS
  2. ONOS-7385

Identity inter file linking to extend-list

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.13.0
    • Fix Version/s: 1.13.0
    • Component/s: YangCompiler
    • Labels:
      None
    • Environment:

      ONOS-YANG-TOOLS

    • Story Points:
      5
    • Epic Link:
    • Sprint:
      N Sprint #2 - Dynamic Config

      Description

      During inter file identity linking, the extend-list to the second level identity is not getting updated.

      ISSUE REPORTED:

       

      I've tried to compile OpenConfig model and to install sample config to openconfig emulator(based on confd) via DynamicDeviceConfigSynchronizer. The config sample is

      {{{ "openconfig-interfaces:interfaces": { "interface": [ { "name": "foo", "config": { "enabled": "true", "type": "ianaift:fastEther" } } ] } } }}

      And the sample code is below

      {{ DefaultInterfaces interfaces = new DefaultInterfaces(); DefaultYangAutoPrefixInterface _interface = new DefaultYangAutoPrefixInterface(); interfaces.addToYangAutoPrefixInterface(_interface); String ifName = "foo"; _interface.name(ifName); DefaultConfig config = new DefaultConfig(); _interface.config(config); config.enabled(true); try { Class<? extends InterfaceType> fastEther = IanaInterfaceType.fromString("fastEther"); config.type(fastEther); } catch (Exception e) { printlog("Instance creation failed: ", e); } printlog("Object to be created: {}", interfaces); ModelObjectData modelData = DefaultModelObjectData.builder() .addModelObject(interfaces) .identifier(null) .build(); ResourceData rnode = modelConverter.createDataNode(modelData); }}

      In this case, I have to use IdentityRef to describe InterfaceType from iana-if-type, and some error related to IdentityRef occurred.

      {{Object to be created: DefaultInterfaces{yangAutoPrefixInterface=[DefaultYangAutoPrefixInterface\{name=hoge, valueLeafFlags=\{1}, config=DefaultConfig\{name=null, type=class org.onosproject.yang.gen.v1.ianaiftype.rev20170330.ianaiftype.FastEther, mtu=0, description=null, enabled=true, valueLeafFlags=\{2, 5}}, state=null, holdTime=null, subinterfaces=null}]} org.onosproject.yang.runtime.impl.ModelConverterException: Value for identity is invalid at org.onosproject.yang.runtime.impl.ModelConverterUtil.getIdentityRefValue(ModelConverterUtil.java:372) at org.onosproject.yang.runtime.impl.ModelConverterUtil.getObjFromType(ModelConverterUtil.java:309) at org.onosproject.yang.runtime.impl.ModelConverterUtil.getLeafObject(ModelConverterUtil.java:573) at org.onosproject.yang.runtime.impl.DataTreeBuilderHelper.processLeaves(DataTreeBuilderHelper.java:769) at org.onosproject.yang.runtime.impl.DataTreeBuilderHelper.processCurSchemaNode(DataTreeBuilderHelper.java:469) at org.onosproject.yang.runtime.impl.DataTreeBuilderHelper.getDataTree(DataTreeBuilderHelper.java:173) at org.onosproject.yang.runtime.impl.DefaultDataTreeBuilder.processNodeObj(DefaultDataTreeBuilder.java:549) at org.onosproject.yang.runtime.impl.DefaultDataTreeBuilder.processDataNodeConversion(DefaultDataTreeBuilder.java:189) at org.onosproject.yang.runtime.impl.DefaultDataTreeBuilder.getResourceData(DefaultDataTreeBuilder.java:155) at org.onosproject.yang.runtime.impl.DefaultModelConverter.createDataNode(DefaultModelConverter.java:48) at org.onosproject.yang.impl.YangRuntimeManager.createDataNode(YangRuntimeManager.java:162) at org.onosproject.d.config.sync.test.TestDyConCommand.executeBody(TestDyConCommand.java:168) at org.onosproject.d.config.sync.test.TestDyConCommand.execute(TestDyConCommand.java:66) at org.onosproject.cli.AbstractShellCommand.doExecute(AbstractShellCommand.java:150) at org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33) at org.apache.karaf.shell.commands.basic.AbstractCommand.execute(AbstractCommand.java:33) at Proxy08afd643_5b58_433b_8412_2373eb79976b.execute(Unknown Source) at Proxy08afd643_5b58_433b_8412_2373eb79976b.execute(Unknown Source) at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78) at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480) at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406) at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108) at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182) at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119) at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94) at org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:210) at org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$1.runConsole(ShellFactoryImpl.java:158) at org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$1$1.run(ShellFactoryImpl.java:133) at java.security.AccessController.doPrivileged(Native Method) at org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:57) at org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$1.run(ShellFactoryImpl.java:129) Error executing command: Value for identity is invalid }}

        Attachments

        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            janani Janani B
            Reporter:
            janani Janani B
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: