<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:54:47 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-956] Augment of mandatory leaf not allowed from within submodule</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-956</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;We are currently using version 2.0.11 of the YANG parser.&lt;/p&gt;

&lt;p&gt;There is a problem with augments of mandatory data. When we parse the model in the attached augmentfailing.zip, the yang parser prints the following warning, and that specific augment is not added:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;2019-02-14 12:47:52,504 WARN [com.nokia.netconf.yang.converter.ExportUtilsTest.main()] augment.AbstractAugmentStatementSupport$1 (AbstractAugmentStatementSupport.java:126) - Failed to add augmentation /home/verthezp/tmp/AugBug/sub-module-1.yang:14:4 defined at /home/verthezp/tmp/AugBug/sub-module-2.yang:22:2
org.opendaylight.yangtools.yang.parser.spi.meta.InferenceException: An augment cannot add node &apos;dummyleaf&apos; because it is mandatory and in module different than target [at /home/verthezp/tmp/AugBug/sub-module-2.yang:16:4]&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;If we look at the RFC, this is in reference to the following section in &lt;a href=&quot;https://tools.ietf.org/html/rfc7950#section-7.17&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://tools.ietf.org/html/rfc7950#section-7.17&lt;/a&gt; :&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;If the augmentation adds mandatory nodes (see Section 3) that&lt;br/&gt;
 represent configuration to a target node in another module, the&lt;br/&gt;
 augmentation MUST be made conditional with a &quot;when&quot; statement. Care&lt;br/&gt;
 must be taken when defining the &quot;when&quot; expression so that clients&lt;br/&gt;
 that do not know about the augmenting module do not break.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;But the augment in sub-module-2.yang is not adding mandatory nodes to a target node in another module: mm:first-augment is belonging to the same module. So the warning of ODL seems to be wrong.&lt;/p&gt;

&lt;p&gt;The model in the attachment augmentok.zip is succeeding, so the problem may be that the augment in sub-module-2.yang in augmentfailing.zip is targeting &apos;/am:another-container/mm:first-augment&apos;, where the first part of the path is indeed in another module. But only the last part of the path determines the target node according to us.&lt;/p&gt;</description>
                <environment></environment>
        <key id="31437">YANGTOOLS-956</key>
            <summary>Augment of mandatory leaf not allowed from within submodule</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.opendaylight.org/images/icons/priorities/major.svg">Medium</priority>
                        <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="rovarga">Robert Varga</assignee>
                                    <reporter username="verthezpw">Peter Verthez</reporter>
                        <labels>
                    </labels>
                <created>Thu, 14 Feb 2019 12:02:51 +0000</created>
                <updated>Thu, 24 Oct 2019 09:15:19 +0000</updated>
                            <resolved>Thu, 24 Oct 2019 09:15:19 +0000</resolved>
                                    <version>2.0.10</version>
                                    <fixVersion>4.0.3</fixVersion>
                    <fixVersion>3.0.7</fixVersion>
                    <fixVersion>2.1.14</fixVersion>
                                    <component>parser</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="66443" author="rovarga" created="Thu, 14 Feb 2019 15:53:01 +0000"  >&lt;p&gt;Rules in &lt;a href=&quot;https://tools.ietf.org/html/rfc7950#section-7.6.5&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://tools.ietf.org/html/rfc7950#section-7.6.5&lt;/a&gt; apply, in this case bullet 1 because mm:first-augment is not a presence container: the augmentation is adding a mandatory node and it is not directly guarded by a when statement. The augmentation introducing &apos;mm:first-augment&apos; is guarded, though, and this should probably cascade. This feels like another aspect of &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-859&quot; title=&quot;Augmenting a container with if-feature&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-859&quot;&gt;&lt;del&gt;YANGTOOLS-859&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="66444" author="rovarga" created="Thu, 14 Feb 2019 15:55:12 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=verthezpw&quot; class=&quot;user-hover&quot; rel=&quot;verthezpw&quot;&gt;verthezpw&lt;/a&gt; would you mind talking to netmod@ietf about perhaps clarifying section 7.17?&lt;/p&gt;</comment>
                            <comment id="66445" author="verthezpw" created="Fri, 15 Feb 2019 07:38:51 +0000"  >&lt;p&gt;OK, we&apos;ll let BBF (Broadband Forum) do this discussion, since this came ultimately from a model that they are standardizing (but working texts are not made public there).   I&apos;ll keep you informed.&lt;/p&gt;</comment>
                            <comment id="66447" author="verthezpw" created="Fri, 15 Feb 2019 09:16:43 +0000"  >&lt;p&gt;In the end somebody of our team initiated the netmod discussion, instead of pushing this to BBF.   See the following thread:&lt;br/&gt;
&lt;a href=&quot;https://mailarchive.ietf.org/arch/msg/netmod/unhiYU1AWcoFMKzUeTh50h4nrSo&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://mailarchive.ietf.org/arch/msg/netmod/unhiYU1AWcoFMKzUeTh50h4nrSo&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="66462" author="verthezpw" created="Tue, 19 Feb 2019 07:44:08 +0000"  >&lt;p&gt;Reply from the netmod mailing list indicates that this should indeed be allowed:&lt;/p&gt;

&lt;p&gt;Re: &lt;span class=&quot;error&quot;&gt;&amp;#91;netmod&amp;#93;&lt;/span&gt; Augmentation with a mandatory leaf in a submodule - Is the following legal?&lt;/p&gt;

&lt;p&gt;Robert Wilton &amp;lt;rwilton@cisco.com&amp;gt; Fri, 15 February 2019 10:08 UTC&lt;/p&gt;

&lt;p&gt;Hi Yves,&lt;/p&gt;

&lt;p&gt;My interpretation of the spirit of the RFC is that this should be &lt;br/&gt;
 allowed, and I don&apos;t think that any text in 7.17 specifically prevents this.&lt;/p&gt;

&lt;p&gt;However, this seems like a corner case, and I am also not surprised that &lt;br/&gt;
 a YANG compiler would fail on this. This issue could perhaps be easily &lt;br/&gt;
 mitigated by making the second augmentation also conditional on the same &lt;br/&gt;
 when statement.&lt;/p&gt;

&lt;p&gt;Note that the use of sub-modules doesn&apos;t really matter, in that a &lt;br/&gt;
 compiler can treat them as one module. So, I think that the problem is &lt;br/&gt;
 equivalent to:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
module module-a {
  yang-version 1.1;
  namespace &lt;span class=&quot;code-quote&quot;&gt;&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//www.example.com/anothermodule&quot;&lt;/span&gt;;
&lt;/span&gt;  prefix am;
  container top {
    leaf type {
      type string; mandatory &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
    }
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160; &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
module module-b {
  yang-version 1.1;
  namespace &lt;span class=&quot;code-quote&quot;&gt;&quot;http:&lt;span class=&quot;code-comment&quot;&gt;//www.example.com/module-b&quot;&lt;/span&gt;;
&lt;/span&gt;  prefix mm;
  augment &lt;span class=&quot;code-quote&quot;&gt;&apos;/am:top&apos;&lt;/span&gt; {
    when &lt;span class=&quot;code-quote&quot;&gt;&quot;am:type = &lt;span class=&quot;code-quote&quot;&gt;&apos;test&apos;&lt;/span&gt;&quot;&lt;/span&gt;;
    container first-augment {
    }
  }
  augment &lt;span class=&quot;code-quote&quot;&gt;&apos;/am:top/mm:first-augment&apos;&lt;/span&gt; {
    leaf mandatory-leaf {
      type string; mandatory &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
    }
  }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Thanks,&lt;br/&gt;
 Rob&lt;/p&gt;</comment>
                            <comment id="66463" author="rovarga" created="Tue, 19 Feb 2019 10:38:34 +0000"  >&lt;p&gt;Thanks for confirming, I&apos;ll take a look at what we need to do to catch this correctly.&lt;/p&gt;</comment>
                            <comment id="66926" author="verthezpw" created="Tue, 25 Jun 2019 09:28:25 +0000"  >&lt;p&gt;Hi, what is the timeline for fixing this?   We are getting some pressure from device teams on this because this is occurring in a standardized model from Broadband Forum and devices are integrating that.   We have provided a workaround (i.e. doing a temporary patch to the YANG model), but still they want to know when ODL will support this so that this workaround would not be needed.&lt;/p&gt;</comment>
                            <comment id="66948" author="rovarga" created="Fri, 28 Jun 2019 09:43:18 +0000"  >&lt;p&gt;Sorry, I am busy with other parts of the system. There is a candidate patch, but has a relatively-high risk, so it won&apos;t be integrated before mid-July, I suspect.&lt;/p&gt;</comment>
                            <comment id="66949" author="verthezpw" created="Fri, 28 Jun 2019 09:47:11 +0000"  >&lt;p&gt;OK, thanks for the update.&lt;/p&gt;</comment>
                            <comment id="67031" author="rovarga" created="Mon, 29 Jul 2019 08:47:07 +0000"  >&lt;p&gt;The fix breaks with OFP models and will need to be reworked.&lt;/p&gt;</comment>
                            <comment id="67324" author="rovarga" created="Tue, 22 Oct 2019 20:17:59 +0000"  >&lt;p&gt;The reason for the failure is that targetCtx.getOriginalCtx() ends up not returning the immediate copy predecessor, but rather the source-level-original definition.&lt;/p&gt;

&lt;p&gt;The basic approach is sound, but we need the ability to walk backwards through the copy history.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="23204">YANGTOOLS-784</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="15101" name="augmentfailing.zip" size="1387" author="verthezpw" created="Thu, 14 Feb 2019 11:51:16 +0000"/>
                            <attachment id="15100" name="augmentok.zip" size="613" author="verthezpw" created="Thu, 14 Feb 2019 11:56:55 +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_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i03mn3:</customfieldvalue>

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