Details
-
Bug
-
Status: Resolved
-
Resolution: Done
-
None
-
None
-
None
-
None
-
Operating System: All
Platform: All
-
2624
-
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
}
grouping add-lsp-args
{ uses lsp-id; } rpc add-lsp {
input
}
}
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
}
}
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?