[YANGTOOLS-402] XXX.getQName() should return namespace of module to which XXX belongs Created: 22/Jan/15  Updated: 10/Apr/22  Resolved: 11/Feb/15

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

Type: Bug
Reporter: Jozef Gloncak Assignee: Peter Kajsa
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: 2624
Priority: High

 Description   

According to documentation method QName.getQname() should contain namespace which:
"XMLNamespace - the namespace assigned to the YANG module which defined element, type, procedure or notification."

Problematic yang source:
module network-topology-pcep {
namespace "urn:opendaylight:params:xml:ns:yang:topology:pcep";
prefix "pn";

import network-topology

{ prefix nt; revision-date 2013-10-21; }

grouping lsp-id {
leaf node

{ type nt:node-ref; mandatory true; }

}

grouping add-lsp-args

{ uses lsp-id; }

rpc add-lsp {
input

{ uses add-lsp-args; }

}
}

In this case >>leaf node<< is defined in network-topology-pcep therefore when on LeafSchemaNode for node is called getQName() then "urn:opendaylight:params:xml:ns:yang:topology:pcep" which is correct.

When getQName() is called from type (LeafSchemaNode.getType().getQName()) then QName with namespace "urn:opendaylight:params:xml:ns:yang:topology:pcep" is also returned. I would expect namespace of network-topology (referenced via nt).

This expected behaviour works for example in this module:
module leafref-module {
namespace "leafref:module";

prefix "lfrfmo";

import referenced-leafref-module

{prefix refleafref; revision-date 2014-12-16;}

revision 2013-11-18 {
}

container cont {
leaf lf4

{ type refleafref:leafreftype; }

}

}

If LeafSchemaNode.getType().getQName() (LeafSchemaNode represent lf4) is called then namespace of augment-leafref-module is returned.

The diference between these modules is that in first case is leaf wrapped in two grouping and in second it is direct child of container.

What is correct behavior? Is it bug?



 Comments   
Comment by Dana Kutenicsova [ 23/Jan/15 ]

Increasing importance and severity as this causes all PCEP tests to fail.

Comment by Robert Varga [ 05/Feb/15 ]

Blocks PCEP usability, hence blocker.

Comment by Robert Varga [ 05/Feb/15 ]

Regression introduced by https://git.opendaylight.org/gerrit/#/c/13684 .

Comment by Peter Kajsa [ 11/Feb/15 ]

https://git.opendaylight.org/gerrit/#/c/15141/1

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