<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:15:51 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>[NETCONF-767] Unable to fetch mounted device&apos;s data when unkeyed and operational list present in device yang</title>
                <link>https://jira.opendaylight.org/browse/NETCONF-767</link>
                <project id="10142" key="NETCONF">netconf</project>
                    <description>&lt;p&gt;Restconf returns &quot;Request could not be completed because the relevant data model content does not exist network-topology:network-topology/topology/topology-netconf/node/{device-name}/yang-ext:mount/Cisco-IOS-XR-mpls-te-oper:mpls-te/tunnel-current-lsp/s2l/resv-rro&quot;&lt;/p&gt;

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

&lt;p&gt;container tunnel-current-lsp {&lt;br/&gt;
&#160; &#160; description &quot;xxxx&quot;;&lt;br/&gt;
&#160; &#160; list s2l {&lt;br/&gt;
&#160; &#160; &#160; &#160;description&#160; &quot;xxx&quot;;&lt;br/&gt;
&#160; &#160; &#160; &#160;list resv-rro { &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;br/&gt;
&#160; &#160; &#160; &#160; &#160;description &quot;yyy&quot;; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;br/&gt;
&#160; &#160; &#160; &#160; &#160; leaf xyz &lt;/p&gt;
{&#160;}
&lt;p&gt;&#160; &#160; &#160; &#160;}&lt;br/&gt;
&#160; &#160; }&lt;/p&gt;

&lt;p&gt;}&lt;/p&gt;

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

&lt;p&gt;When unkeyed and operational list is present in device yang , we were unable to fetch that particular list.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="33779">NETCONF-767</key>
            <summary>Unable to fetch mounted device&apos;s data when unkeyed and operational list present in device yang</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="10003" iconUrl="https://jira.opendaylight.org/images/icons/status_generic.gif" description="">Confirmed</status>
                    <statusCategory id="2" key="new" colorName="blue-gray"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="ivanm1996">Ivan Martiniak</assignee>
                                    <reporter username="Sarguna_Dharani">Sarguna Dharani</reporter>
                        <labels>
                    </labels>
                <created>Fri, 5 Feb 2021 15:00:36 +0000</created>
                <updated>Tue, 1 Feb 2022 19:14:55 +0000</updated>
                                            <version>2.0.13</version>
                                                    <component>netconf</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="69003" author="rovarga" created="Tue, 16 Feb 2021 17:14:30 +0000"  >&lt;p&gt;So this needs a stack trace to go with it&lt;/p&gt;</comment>
                            <comment id="69007" author="JIRAUSER12948" created="Tue, 2 Mar 2021 14:17:32 +0000"  >&lt;p&gt;Hi Robert,&lt;/p&gt;

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

&lt;p&gt;Replicated the issue using the test case&lt;br/&gt;
 &#160;&lt;br/&gt;
 When netconf convert xml to Normalized node , we hit getDirectChild of Yangtools to find exact node using path arguments.&lt;/p&gt;

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

&lt;p&gt;-------------------&lt;/p&gt;

&lt;p&gt;NETCONF&lt;/p&gt;

&lt;p&gt;---------------------&lt;/p&gt;

&lt;p&gt;package org.opendaylight.netconf.sal.connect.netconf.util;&lt;/p&gt;

&lt;p&gt;import java.io.IOException;&lt;br/&gt;
 import java.net.URISyntaxException;&lt;br/&gt;
 import java.util.Optional;&lt;br/&gt;
 import javax.xml.stream.XMLStreamException;&lt;br/&gt;
 import org.opendaylight.netconf.api.ModifyAction;&lt;br/&gt;
 import org.opendaylight.netconf.util.NetconfUtil;&lt;br/&gt;
 import org.opendaylight.yangtools.rfc8528.data.api.MountPointContext;&lt;br/&gt;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;&lt;br/&gt;
 import org.opendaylight.yangtools.yang.data.api.schema.DOMSourceAnyxmlNode;&lt;br/&gt;
 import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild;&lt;br/&gt;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;&lt;br/&gt;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodes;&lt;br/&gt;
 import org.opendaylight.yangtools.yang.data.impl.schema.NormalizedNodeResult;&lt;br/&gt;
 import org.slf4j.Logger;&lt;br/&gt;
 import org.slf4j.LoggerFactory;&lt;br/&gt;
 import org.xml.sax.SAXException;&lt;/p&gt;

&lt;p&gt;/**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Transforms rpc structures to normalized nodes and vice versa.&lt;br/&gt;
 */&lt;br/&gt;
 class NetconfRpcStructureTransformer implements RpcStructureTransformer {&lt;br/&gt;
 private static final Logger LOG = LoggerFactory.getLogger(NetconfRpcStructureTransformer.class);&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;private final MountPointContext mountContext;&lt;/p&gt;

&lt;p&gt;NetconfRpcStructureTransformer(final MountPointContext mountContext)&lt;/p&gt;

{ &#160; &#160; &#160; this.mountContext = mountContext; }

&lt;p&gt;@Override&lt;br/&gt;
 public Optional&amp;lt;NormalizedNode&amp;lt;?, ?&amp;gt;&amp;gt; selectFromDataStructure(&lt;br/&gt;
 final DataContainerChild&amp;lt;? extends YangInstanceIdentifier.PathArgument, ?&amp;gt; data,&lt;br/&gt;
 final YangInstanceIdentifier path) {&lt;br/&gt;
 &#160; &#160; &#160; &#160; if (data instanceof DOMSourceAnyxmlNode) {&lt;br/&gt;
 &#160; &#160; &#160; &#160; &#160; &#160; final NormalizedNodeResult node;&lt;br/&gt;
 &#160; &#160; &#160; &#160; &#160; &#160; try&lt;/p&gt;

{ &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; node = NetconfUtil.transformDOMSourceToNormalizedNode(mountContext, &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; ((DOMSourceAnyxmlNode)data).getValue()); &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; *Optional&amp;lt;NormalizedNode&amp;lt;?, ?&amp;gt;&amp;gt; result = NormalizedNodes.findNode(node.getResult(),* &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; *path.getPathArguments());* &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; return result; &#160; &#160; &#160; &#160; &#160; &#160; }

&lt;p&gt;catch (final XMLStreamException | URISyntaxException | IOException | SAXException e)&lt;/p&gt;

{ &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;LOG.error(&quot;Cannot parse anyxml.&quot;, e); &#160; &#160; &#160; &#160; &#160; &#160; &#160; return Optional.empty(); &#160; &#160; &#160; &#160; &#160; &#160; }

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

{ &#160; &#160; &#160; &#160; &#160; &#160; return NormalizedNodes.findNode(data, path.getPathArguments()); &#160; &#160; &#160; &#160; &#160; &#160;}

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

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

&lt;p&gt;----------------&lt;/p&gt;

&lt;p&gt;YANGTOOLS&lt;/p&gt;

&lt;p&gt;-----------------&lt;/p&gt;

&lt;p&gt;package org.opendaylight.yangtools.yang.data.api.schema;&lt;/p&gt;

&lt;p&gt;....&lt;/p&gt;

&lt;p&gt;/**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;A set of utility methods for interacting with {@link NormalizedNode} objects.&lt;br/&gt;
 */&lt;br/&gt;
 @Beta&lt;br/&gt;
 public final class NormalizedNodes {&lt;/li&gt;
&lt;/ul&gt;


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

&lt;p&gt;......&lt;/p&gt;

&lt;p&gt;public static Optional&amp;lt;NormalizedNode&amp;lt;?, ?&amp;gt;&amp;gt; findNode(final Optional&amp;lt;NormalizedNode&amp;lt;?, ?&amp;gt;&amp;gt; parent,&lt;br/&gt;
 final Iterable&amp;lt;PathArgument&amp;gt; relativePath) {&lt;br/&gt;
 &#160; &#160; &#160; &#160; &#160;final Iterator&amp;lt;PathArgument&amp;gt; pathIterator = requireNonNull(relativePath, &quot;Relative path must not be null&quot;)&lt;br/&gt;
 &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; .iterator();&lt;br/&gt;
 &#160; &#160; &#160; &#160; &#160; Optional&amp;lt;NormalizedNode&amp;lt;?, ?&amp;gt;&amp;gt; currentNode = requireNonNull(parent, &quot;Parent must not be null&quot;);&lt;br/&gt;
 &#160; &#160; &#160; &#160; &#160; while (currentNode.isPresent() &amp;amp;&amp;amp; pathIterator.hasNext())&lt;/p&gt;

{ &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; *currentNode = getDirectChild(currentNode.get(), pathIterator.next());* &#160; &#160; &#160; &#160; &#160; &#160;}

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

&lt;p&gt;}&lt;/p&gt;

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

&lt;p&gt;PFA for&#160; changes added in test case to replicate UnkeyedListNode issue.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://jira.opendaylight.org/secure/attachment/16100/16100_YANGTOOLS-1221-testcase.docx&quot; title=&quot;YANGTOOLS-1221-testcase.docx attached to NETCONF-767&quot;&gt;YANGTOOLS-1221-testcase.docx&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://jira.opendaylight.org/images/icons/link_attachment_7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

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

&lt;p&gt;Please let me know if you need more information.&lt;/p&gt;</comment>
                            <comment id="69024" author="rovarga" created="Wed, 17 Mar 2021 08:50:46 +0000"  >&lt;p&gt;Well, children of UnkeyedListNode are not adressable through PathArgument. They can only be either iterated or selected by offset.&lt;/p&gt;

&lt;p&gt;For the code in your test case, this translates to the question: how would NormalizedNodes know to select the child at offset 0 (as opposed to any other offset)?&lt;/p&gt;

&lt;p&gt;This needs to be fixed NETCONF-side.&lt;/p&gt;</comment>
                            <comment id="70506" author="rovarga" created="Tue, 1 Feb 2022 19:14:35 +0000"  >&lt;p&gt;Can you post karaf logs with NETCONF debugs enabled, please?&lt;br/&gt;
I believe the problem here is that NETCONF code is trying something funky, i.e. attempting to access a single item by a PathArgument (as per my previous comment).&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="16100" name="YANGTOOLS-1221-testcase.docx" size="110166" author="Sarguna_Dharani" created="Tue, 2 Mar 2021 13:42:32 +0000"/>
                            <attachment id="17103" name="[NETCONF-767] Steps to reproduce.docx" size="28519" author="ivanm1996" created="Mon, 6 Dec 2021 12:18:56 +0000"/>
                            <attachment id="17104" name="unkeyed-list-module.yang" size="247" author="ivanm1996" created="Mon, 6 Dec 2021 12:18:56 +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|i03wzb:</customfieldvalue>

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