<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:53:40 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[YANGTOOLS-583] Error when augmenting a mandatory node on a container in the same module</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-583</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;In one of the proposed BBF (Broadband Forum) models we are getting an error during parsing, which is, according to us a bug in the YANG parser.   We are using the Lithium release currently (the original one, not one of the SRs).&lt;/p&gt;

&lt;p&gt;I&apos;m not allowed to attach the BBF model here, but I&apos;ve reproduced the bug with a dummy model based on the example jukebox model, which I&apos;m attaching here.&lt;/p&gt;

&lt;p&gt;The situation is:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;the jukebox-cd module is augmenting the &quot;jukebox&quot; container with an extra child container &quot;cdcapable&quot;, which is a container with presence (this last point is crucial)&lt;/li&gt;
	&lt;li&gt;the jukebox-cd-sub submodule of the jukebox-cd module is then further augmenting that &quot;cdcapable&quot; container with a mandatory leaf &quot;number-of-cds&quot;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;When we parse this via the YANG parser, we are getting the following error:&lt;/p&gt;

&lt;p&gt;Error in module &apos;jukebox-cd-sub&apos; at line 27: Error in augment parsing: cannot augment mandatory node number-of-cds&lt;br/&gt;
org.opendaylight.yangtools.yang.parser.util.YangParseException: Error in module &apos;jukebox-cd-sub&apos; at line 27: Error in augment parsing: cannot augment mandatory node number-of-cds&lt;br/&gt;
	at org.opendaylight.yangtools.yang.parser.impl.YangParserImpl.checkAugmentMandatoryNodes(YangParserImpl.java:882)&lt;br/&gt;
	at org.opendaylight.yangtools.yang.parser.impl.YangParserImpl.resolveAugments(YangParserImpl.java:908)&lt;br/&gt;
	at org.opendaylight.yangtools.yang.parser.impl.YangParserImpl.build(YangParserImpl.java:712)&lt;br/&gt;
	at org.opendaylight.yangtools.yang.parser.impl.YangParserImpl.parseYangModelSources(YangParserImpl.java:358)&lt;br/&gt;
	at org.opendaylight.yangtools.yang.parser.impl.YangParserImpl.parseYangModelsMapped(YangParserImpl.java:282)&lt;br/&gt;
	at org.opendaylight.yangtools.yang.parser.impl.YangParserImpl.parseFiles(YangParserImpl.java:159)&lt;/p&gt;

&lt;p&gt;According to us, and the people in the BBF working group, the given augment should be allowed.&lt;/p&gt;

&lt;p&gt;In the RFC it says:&lt;br/&gt;
   If the target node is in another module, then nodes added by the&lt;br/&gt;
   augmentation MUST NOT be mandatory nodes (see Section 3.1).&lt;/p&gt;

&lt;p&gt;But here the target node is in the same module (the augment is in a submodule of that module, but we assume that should not matter).   &lt;/p&gt;

&lt;p&gt;Also, according to the spirit of the RFC, the fact that the &quot;cdcapable&quot; container is a container with presence, makes that this is a safe augmentation which can&apos;t give a problem in clients that don&apos;t use the jukebox-cd module (the case of a container without presence is also not forbidden by the letter of the RFC, but could indeed pose a problem for such clients).&lt;/p&gt;

&lt;p&gt;Is our understanding correct, so that this is a bug in yang-tools?&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="23003">YANGTOOLS-583</key>
            <summary>Error when augmenting a mandatory node on a container in the same module</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                                <status id="5" iconUrl="https://jira.opendaylight.org/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="pkajsa">Peter Kajsa</assignee>
                                    <reporter username="verthezpw">Peter Verthez</reporter>
                        <labels>
                    </labels>
                <created>Fri, 12 Feb 2016 10:10:26 +0000</created>
                <updated>Sun, 10 Apr 2022 18:35:44 +0000</updated>
                            <resolved>Fri, 11 Mar 2016 10:41:04 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="43755" author="verthezpw" created="Fri, 12 Feb 2016 10:10:26 +0000"  >&lt;p&gt;Attachment yangs.tgz has been added with description: Example model&lt;/p&gt;</comment>
                            <comment id="43743" author="rovarga" created="Fri, 12 Feb 2016 14:46:34 +0000"  >&lt;p&gt;Since the augment is within the same module, I think this is a bug. Can you check if this is reproducible with Beryllium RC3 and/or Lithium SR3, please?&lt;/p&gt;</comment>
                            <comment id="43744" author="verthezpw" created="Fri, 12 Feb 2016 14:55:35 +0000"  >&lt;p&gt;I encountered the same bug in Lithium SR3 (which is why we didn&apos;t upgrade to it yet).   I&apos;ll try Beryllium RC3.&lt;/p&gt;</comment>
                            <comment id="43745" author="verthezpw" created="Fri, 12 Feb 2016 15:23:22 +0000"  >&lt;p&gt;I couldn&apos;t find Beryllium RC3 in the Nexus repositories of Opendaylight, so I tried with RC2.2.&lt;/p&gt;

&lt;p&gt;But this is apparently not backward compatible with Lithium (some classes are not found), so it would require changes in our application.   So I couldn&apos;t test with that.&lt;/p&gt;</comment>
                            <comment id="43746" author="ifoltin" created="Mon, 22 Feb 2016 13:44:28 +0000"  >&lt;p&gt;The first part of the augment target path in submodule jukebox-cd-sub &lt;br/&gt;
(augment &quot;/jbox:jukebox/jboxcd:cdcapable&quot;) targets imported module - that means &lt;br/&gt;
it is not in the same module.&lt;/p&gt;</comment>
                            <comment id="43747" author="verthezpw" created="Mon, 29 Feb 2016 08:28:42 +0000"  >&lt;p&gt;According to me the RFC defines the target node as the node to which new nodes are added (first paragraph in section 7.15 in the YANG RFC).  And it then gives the constraint on the target node, not on any of its parent nodes.&lt;/p&gt;

&lt;p&gt;Can you give a reference in the RFC that supports your statement?&lt;/p&gt;</comment>
                            <comment id="43748" author="tony.tkacik@gmail.com" created="Mon, 29 Feb 2016 08:43:05 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;



&lt;p&gt;yes you are correct that YANG does not explicit mention this situation (augmenting augmentation) but according to the rule you cited &lt;/p&gt;

&lt;p&gt;Following would be incorrect:&lt;/p&gt;

&lt;p&gt;augment &quot;/other:module&quot; {&lt;/p&gt;

&lt;p&gt;   container foo {&lt;br/&gt;
       leaf bar &lt;/p&gt;
{
           mandatory true;
       }
&lt;p&gt;   }&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;and alternative writing of same would be correct:&lt;/p&gt;

&lt;p&gt;augment &quot;/other:module&quot; {&lt;br/&gt;
   container foo {}&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;augment &quot;/other:module/foo&quot; {&lt;br/&gt;
   leaf bar &lt;/p&gt;
{
       mandatatory true;
   }
&lt;p&gt;}&lt;/p&gt;


&lt;p&gt;In draft-netmod-rfc6020bis addition of mandatory nodes via augment was allowed given that&lt;br/&gt;
augmentation is conditional by when statement.&lt;/p&gt;

&lt;p&gt;Could you open this issue on ietf-netmod mailing list? So we can get also opiniion from YANG authors?&lt;/p&gt;</comment>
                            <comment id="43749" author="verthezpw" created="Mon, 29 Feb 2016 08:58:26 +0000"  >&lt;p&gt;That example does not correspond to what I reported.  It is rather:&lt;/p&gt;

&lt;p&gt;augment &quot;/other:module&quot; {&lt;/p&gt;

&lt;p&gt;   container foo {&lt;br/&gt;
       presence &quot;some reason&quot;;&lt;br/&gt;
       leaf bar &lt;/p&gt;
{
           mandatory true;
       }
&lt;p&gt;   }&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;But I will send a mail on the ietf-netmod mailing list.&lt;/p&gt;</comment>
                            <comment id="43750" author="verthezpw" created="Tue, 1 Mar 2016 07:40:53 +0000"  >&lt;p&gt;See the answer from the ietf-netmod mailing list here:&lt;br/&gt;
&lt;a href=&quot;http://www.ietf.org/mail-archive/web/netmod/current/msg15407.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.ietf.org/mail-archive/web/netmod/current/msg15407.html&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="43751" author="tony.tkacik@gmail.com" created="Tue, 1 Mar 2016 11:56:29 +0000"  >&lt;p&gt;Ok, I added reasoning based on discussions, why such augment should be allowed:&lt;/p&gt;


&lt;p&gt;Section 7.15 (&lt;a href=&quot;https://tools.ietf.org/html/rfc6020#section-7.15&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://tools.ietf.org/html/rfc6020#section-7.15&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&amp;gt;    If the target node is in another module, then nodes added by the&lt;br/&gt;
&amp;gt;    augmentation MUST NOT be mandatory nodes (see Section 3.1).&lt;/p&gt;

&lt;p&gt;Section 3.1 (&lt;a href=&quot;https://tools.ietf.org/html/rfc6020#section-3.1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://tools.ietf.org/html/rfc6020#section-3.1&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&amp;gt;  A mandatory node is one of:&lt;br/&gt;
&amp;gt;&lt;br/&gt;
&amp;gt;   o  A leaf, choice, or anyxml node with a &quot;mandatory&quot; statement with&lt;br/&gt;
&amp;gt;      the value &quot;true&quot;.&lt;/p&gt;

&lt;p&gt;&amp;gt;   o  A list or leaf-list node with a &quot;min-elements&quot; statement with a&lt;br/&gt;
&amp;gt;      value greater than zero.&lt;br/&gt;
&amp;gt;   o  A container node without a &quot;presence&quot; statement, which has at&lt;br/&gt;
&amp;gt;      least one mandatory node as a child.&lt;/p&gt;


&lt;p&gt;Section 3.1 lists presence container as not mandatory node, &lt;br/&gt;
so adding presence container (using augmentations) could be considered &lt;br/&gt;
compatible, since clients not understanding augmenting model still would be able&lt;br/&gt;
to use / configure original model correctly.&lt;/p&gt;

&lt;p&gt;Indeed this is bug, which affects Lithium, Beryllium and Boron.&lt;/p&gt;</comment>
                            <comment id="43752" author="pkajsa" created="Tue, 8 Mar 2016 08:47:14 +0000"  >&lt;p&gt;fix: &lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/35880/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/35880/&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="43753" author="rovarga" created="Wed, 9 Mar 2016 09:50:12 +0000"  >&lt;p&gt;Master merged, needs manual cherry-pick to beryllium.&lt;/p&gt;</comment>
                            <comment id="43754" author="pkajsa" created="Wed, 9 Mar 2016 13:38:48 +0000"  >&lt;p&gt;fix stable/beryllium: &lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/35985/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/35985/&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="13040" name="yangs.tgz" size="1813" author="verthezpw" created="Fri, 12 Feb 2016 10:10:26 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5335</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10201" key="com.atlassian.jira.plugin.system.customfieldtypes:url">
                        <customfieldname>External issue URL</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[https://bugs.opendaylight.org/show_bug.cgi?id=5335]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10206" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Issue Type</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10300"><![CDATA[Bug]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10204" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>ODL SR Target Milestone</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10330"><![CDATA[Beryllium-1]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i0284f:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>