[CONTROLLER-655] Config-sub sys code generator not handling container with uses statement Created: 29/Jul/14  Updated: 30/Jul/14  Due: 31/Jul/14  Resolved: 30/Jul/14

Status: Resolved
Project: controller
Component/s: config
Affects Version/s: Helium
Fix Version/s: None

Type: Bug
Reporter: Wojciech Dec Assignee: Maros Marsalek
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Mac OS
Platform: PC


External issue ID: 1451

 Description   

The config code generator reports an error when using the a config with a container containing a "uses" statement. The generator accepts the uses statement without the container.

[ERROR] yang-to-sources: Unable to generate sources with org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator generator
java.lang.IllegalStateException: Unexpected 'refine' child node size of container authz-data
at com.google.common.base.Preconditions.checkState(Preconditions.java:149)
at org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntryBuilder.extractDependency(ModuleMXBeanEntryBuilder.java:473)
at org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntryBuilder.getAttributeValue(ModuleMXBeanEntryBuilder.java:443)
at org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntryBuilder.fillConfiguration(ModuleMXBeanEntryBuilder.java:411)
at org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntryBuilder.processChoiceCaseNode(ModuleMXBeanEntryBuilder.java:274)
at org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntryBuilder.build(ModuleMXBeanEntryBuilder.java:137)
at org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry.create(ModuleMXBeanEntry.java:160)
at org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator.generateSources(JMXGenerator.java:134)

module aaa-authz-service-impl {

yang-version 1;
namespace "urn:opendaylight:params:xml:ns:yang:controller:config:aaa-authz:srv";
prefix "aaa-authz-srv-impl";

import config

{ prefix config; revision-date 2013-04-05; }

import opendaylight-md-sal-binding

{ prefix mdsal; revision-date 2013-10-28; }

import authorization-schema

{ prefix authzs; revision-date 2014-07-22; }

revision "2014-07-01"

{ description "Initial revision."; }

// This is the definition of the service implementation as a module identity.
identity aaa-authz-service

{ base config:module-type; // Specifies the prefix for generated java classes. config:java-name-prefix AuthzSrv; }

// Augments the 'configuration' choice node under modules/module.
augment "/config:modules/config:module/config:configuration" {
case aaa-authz-service {
when "/config:modules/config:module/config:type = 'aaa-authz-service'";

container data-broker {
uses config:service-ref {
refine type

{ mandatory false; config:required-identity mdsal:binding-data-broker; }

}
}

container authz-data

{ uses authzs:authorization-grp; }

}
}



 Comments   
Comment by Maros Marsalek [ 30/Jul/14 ]

Hi Wojciech,

I fixed very similar bug (probably the same) yesterday. It was 1410. Could you please re-check with latest code for ODL ? The fix is already merged into master.

Changing status to works for me, please recheck and reopen if necessary.
Providing the schema for grouping authzs:authorization-grp; might be helpful if the fix does not work for you.

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