<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:54:39 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-911] Nodes in augmentations do not inherit config statement from augmented parent </title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-911</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;Yangtools parser doesn t inherit parent config statement if it comes from augmentations. Meaning if we are augmenting container that is &lt;b&gt;&quot;config false;&quot;&lt;/b&gt; all the nodes in that augmentation should be config false too without need of setting them to config false; but they are not if they are not explicitly set to config false inside of augmentation statement.&lt;/p&gt;

&lt;p&gt;The following code:&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;
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; ch.qos.logback.classic.Level;
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; ch.qos.logback.classic.Logger;
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; java.io.File;
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; java.io.IOException;
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; java.util.Iterator;
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; java.util.ServiceLoader;
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; org.opendaylight.yangtools.yang.common.QName;
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; org.opendaylight.yangtools.yang.common.Revision;
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; org.opendaylight.yangtools.yang.model.api.AugmentationSchemaNode;
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; org.opendaylight.yangtools.yang.model.api.Module;
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; org.opendaylight.yangtools.yang.model.api.SchemaContext;
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; org.opendaylight.yangtools.yang.model.parser.api.YangParser;
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; org.opendaylight.yangtools.yang.model.parser.api.YangParserException;
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; org.opendaylight.yangtools.yang.model.parser.api.YangParserFactory;
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; org.slf4j.LoggerFactory;

&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;class &lt;/span&gt;Main {

    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; YangParserFactory PARSER_FACTORY;
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; Logger LOG = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);


    &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; {
        LOG.setLevel(Level.INFO);
        &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; Iterator&amp;lt;YangParserFactory&amp;gt; it = ServiceLoader.load(YangParserFactory.class).iterator();
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!it.hasNext()) {
            &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; IllegalStateException(&lt;span class=&quot;code-quote&quot;&gt;&quot;No YangParserFactory found&quot;&lt;/span&gt;);
        }
        PARSER_FACTORY = it.next();
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; void main(&lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;[] args) &lt;span class=&quot;code-keyword&quot;&gt;throws&lt;/span&gt; IOException, YangParserException {
        &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; YangParser parser = PARSER_FACTORY.createParser();

        &lt;span class=&quot;code-comment&quot;&gt;// add sources with its dependents
&lt;/span&gt;        parser.addSource(YangTextSchemaSource.forFile(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; File(&lt;span class=&quot;code-quote&quot;&gt;&quot;&amp;lt;path_to_file&amp;gt;/ietf-ipv4-unicast-routing@2018-03-13.yang&quot;&lt;/span&gt;)));
        parser.addLibSource(YangTextSchemaSource.forFile(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; File(&lt;span class=&quot;code-quote&quot;&gt;&quot;&amp;lt;path_to_file&amp;gt;/ietf-routing@2018-03-13.yang&quot;&lt;/span&gt;)));
        parser.addLibSource(YangTextSchemaSource.forFile(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; File(&lt;span class=&quot;code-quote&quot;&gt;&quot;&amp;lt;path_to_file&amp;gt;/ietf-interfaces@2018-02-20.yang&quot;&lt;/span&gt;)));
        parser.addLibSource(YangTextSchemaSource.forFile(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; File(&lt;span class=&quot;code-quote&quot;&gt;&quot;&amp;lt;path_to_file&amp;gt;/ietf-yang-types@2013-07-15.yang&quot;&lt;/span&gt;)));
        parser.addLibSource(YangTextSchemaSource.forFile(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; File(&lt;span class=&quot;code-quote&quot;&gt;&quot;&amp;lt;path_to_file&amp;gt;/ietf-inet-types@2013-07-15.yang&quot;&lt;/span&gt;)));

        &lt;span class=&quot;code-comment&quot;&gt;// build schema context
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; SchemaContext schemaContext = parser.buildSchemaContext();
        &lt;span class=&quot;code-comment&quot;&gt;// get module
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; Module module = schemaContext.findModule(&lt;span class=&quot;code-quote&quot;&gt;&quot;ietf-ipv4-unicast-routing&quot;&lt;/span&gt;, Revision.of(&lt;span class=&quot;code-quote&quot;&gt;&quot;2018-03-13&quot;&lt;/span&gt;)).get();
        &lt;span class=&quot;code-comment&quot;&gt;// iterate through all the augmentations
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt;(&lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; AugmentationSchemaNode augNode : module.getAugmentations()) {
            &lt;span class=&quot;code-comment&quot;&gt;// build augmentation path
&lt;/span&gt;            &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; StringBuilder pathBuilder = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; StringBuilder();
            &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; (QName qname : augNode.getTargetPath().getPathFromRoot()) {
                pathBuilder.append(&lt;span class=&quot;code-quote&quot;&gt;&apos;/&apos;&lt;/span&gt;)
                        .append(qname.getLocalName());
            }
            LOG.info(&lt;span class=&quot;code-quote&quot;&gt;&quot;augmentation path: &quot;&lt;/span&gt; + pathBuilder.toString());
            &lt;span class=&quot;code-comment&quot;&gt;// iterate through nodes in each augmentation
&lt;/span&gt;            &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt;(DataSchemaNode node :augNode.getChildNodes()){
                &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt; name = node.getQName().getLocalName();
                &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;boolean&lt;/span&gt; isConfig = node.isConfiguration();
                LOG.info(&lt;span class=&quot;code-quote&quot;&gt;&quot;node &quot;&lt;/span&gt; + name + &lt;span class=&quot;code-quote&quot;&gt;&quot; isConfig &quot;&lt;/span&gt; + isConfig);
            }
        }
    }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Please change &amp;lt;path_to_file&amp;gt; to wherever your file is. you can find these files in &lt;a href=&quot;https://github.com/YangModels/yang/tree/master/standard/ietf/RFC&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this github repo.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So this code returns output like this.&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;12:59:16.253 [main] INFO ROOT - augmentation path: /routing/ribs/rib/routes/route
12:59:16.263 [main] INFO ROOT - node destination-prefix isConfig true
12:59:16.263 [main] INFO ROOT - augmentation path: /routing/ribs/rib/routes/route/next-hop/next-hop-options/simple-next-hop
12:59:16.263 [main] INFO ROOT - node next-hop-address isConfig true
12:59:16.263 [main] INFO ROOT - augmentation path: /routing/ribs/rib/routes/route/next-hop/next-hop-options/next-hop-list/next-hop-list/next-hop
12:59:16.263 [main] INFO ROOT - node address isConfig true
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;but already in first augmentation we can see that /routing/ribs/rib/routes/route &lt;br/&gt;
 is following in yang.&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;container routes {
          config false;
          description
            &quot;Current contents of the RIB.&quot;;
          list route {
            description
              &quot;A RIB route entry.  This data node MUST be augmented
               with information specific to routes of each address
               family.&quot;;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Right on the second line container routes is of &lt;font color=&quot;#ff0000&quot;&gt;config false;&lt;/font&gt; which means that list route must be config false too and everything in it even if we augmenting. but our node in that augmentation is node destination-prefix and its isConfig is set to true.&lt;/p&gt;</description>
                <environment></environment>
        <key id="30904">YANGTOOLS-911</key>
            <summary>Nodes in augmentations do not inherit config statement from augmented parent </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="miro.kovac">Miroslav Kovac</reporter>
                        <labels>
                    </labels>
                <created>Wed, 17 Oct 2018 11:20:11 +0000</created>
                <updated>Mon, 22 Oct 2018 11:43:06 +0000</updated>
                            <resolved>Mon, 22 Oct 2018 11:43:06 +0000</resolved>
                                                                    <component>parser</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="65385" author="rovarga" created="Mon, 22 Oct 2018 11:42:11 +0000"  >&lt;p&gt;This is the duality of available augmentations vs. instantiated types. Instantiated nodes within the target have the correct type, while the nodes within the copied augmentation have configuration set to the logical value of the &lt;b&gt;augmentation&lt;/b&gt; &#8211; i.e. inherited from parent, which is root, which is config=true.&lt;/p&gt;</comment>
                            <comment id="65386" author="rovarga" created="Mon, 22 Oct 2018 11:43:06 +0000"  >&lt;p&gt;There is nothing to fix here: the nodes available through ContainerSchemaNode.findDataTreeChild() return the correct configuration value.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </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|i03jqf:</customfieldvalue>

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