[MDSAL-168] Augmenting a choice without a case results in no getter/setter Created: 13/May/16  Updated: 09/Mar/18  Resolved: 25/Jul/16

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

Type: Bug
Reporter: Lori Jakab Assignee: Filip Gregor
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: 5884

 Description   

See also MDSAL-133.

We have the following augments in a model (https://git.opendaylight.org/gerrit/gitweb?p=lispflowmapping.git;a=blob;f=mappingservice/lisp-proto/src/main/yang/odl-lisp-address-types.yang;h=2637ebc222fb6b58eb907b2fd6f346ca1a7e3c37;hb=HEAD):

grouping augmented-lisp-address {
uses laddr:lisp-address {
augment "address" {
leaf ipv4-binary {
when "../../address-type = 'ipv4-binary-afi'"

{ description "When AFI is IPv4 (binary)."; }

type bin:ipv4-address-binary;
description
"IPv4 (binary) address.";
}
leaf ipv6-binary {
when "../../address-type = 'ipv6-binary-afi'"

{ description "When AFI is IPv6 (binary)."; }

type bin:ipv6-address-binary;
description
"IPv6 (binary) address.";
}
}
}
}

The "address" that is augmented is a choice, that doesn't have 'case' statements.

The yangtools generated Ipv

{4,6}Binary and objects don't have any getter method to access the leaf value, and the Ipv{4,6}

BinaryBuilder object can't set or get the leaf either. Looking at the comment at the top of the auto-generated Java classes, and comparing it to the non-augmented counterparts reveals that the latter seem to add a 'case' statement to the YANG snippet, even if the original model doesn't have it. Manually adding a 'case' to the above augment solves the problem, and getters/setters become available.



 Comments   
Comment by Filip Gregor [ 14/Jun/16 ]

Proposed fix: https://git.opendaylight.org/gerrit/#/c/40158/

Comment by Robert Varga [ 07/Jul/16 ]

Needs manual cherry-pick to Beryllium

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