[MDSAL-209] Could not find Choice node parent AbsoluteSchemaPath Created: 28/Nov/16  Updated: 09/Mar/18  Resolved: 22/Dec/16

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

Type: Bug
Reporter: zhuweisheng Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 7249

 Description   

I get a Error when trying to parse a yang file like below:
choice pool-type {
container interface-pool {
leaf dddd

{ type string; }

list sub-option {
description "Specifieds the user defined DHCP sub options";
key sub-option-code;

leaf sub-option-code {
description "The sub option code of the user defined option";
type uint8

{ range "1..254"; }

}
choice option-format {
leaf-list ip-address

{ description "IP address list"; type string; }

}
}
}
}

the error is:
[ERROR] yang-to-sources: Unable to generate sources with org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl generator
java.lang.IllegalStateException: Could not find Choice node parent AbsoluteSchemaPath

{path=[(com:huawei:controller:application:test?revision=2016-07-12)pool-type, (com:huawei:controller:application:test?revision=2016-07-12)interface-pool, (com:huawei:controller:application:test?revision=2016-07-12)sub-option]}

at com.google.common.base.Preconditions.checkState(Preconditions.java:197)
...

Why compilation of this yang failure?



 Comments   
Comment by Peter Kajsa [ 28/Nov/16 ]

It seems to be a binding generator issue, so moved to mdsal.

Comment by Martin Ciglan [ 28/Nov/16 ]

Hi

I am able to generate Java files without any issues. As far as I haven't got more information from you, my pool-type choice sits in root of model.

Please answer 2 questions:
1. What ODL version are you using? Beryllium, Boron, Carbon (master) ?
2. Provide full model - where is pool-type choice?

Regards

Martin

Comment by zhuweisheng [ 29/Nov/16 ]

(In reply to Martin Ciglan from comment #2)
> Hi
>
> I am able to generate Java files without any issues. As far as I haven't got
> more information from you, my pool-type choice sits in root of model.
>
> Please answer 2 questions:
> 1. What ODL version are you using? Beryllium, Boron, Carbon (master) ?
> 2. Provide full model - where is pool-type choice?
>
> Regards
>
> Martin

1. ODL version is Lithium-SR1.
2. This is full model.

Regards

Comment by Martin Ciglan [ 29/Nov/16 ]

Hi

Lithium and Beryylium are not supported anymore, so I recommend to switch to
Boron SR1. Let me know results, I tested it with Carbon master and there is no issue. Quite a lot of bugs with code generator have been fixed in Berylliumn SRs, so Boron should be the best for you. Thanks.

Comment by zhuweisheng [ 29/Nov/16 ]

(In reply to Martin Ciglan from comment #4)
> Hi
>
> Lithium and Beryylium are not supported anymore, so I recommend to switch to
> Boron SR1. Let me know results, I tested it with Carbon master and there is
> no issue. Quite a lot of bugs with code generator have been fixed in
> Berylliumn SRs, so Boron should be the best for you. Thanks.

Thank you very much.

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