RIFT-15222: Several relative leafref paths need to be fixed to include reference to current node
Original-fix-by: Kiran Kashalkar <kiran.kashalkar@riftio.com>
Signed-off-by: Philip Joseph <philip.joseph@riftio.com>
diff --git a/models/plugins/yang/nsd.yang b/models/plugins/yang/nsd.yang
index a0847f9..494acf4 100644
--- a/models/plugins/yang/nsd.yang
+++ b/models/plugins/yang/nsd.yang
@@ -272,7 +272,11 @@
to leafref, whose target is in a different module.
Once that is resovled this will switched to use
leafref";
- type string;
+ type leafref {
+ path "../../../constituent-vnfd" +
+ "[member-vnf-index = current()/../member-vnf-index-ref]" +
+ "/vnfd-id-ref";
+ }
}
leaf vnfd-connection-point-ref {
@@ -607,7 +611,9 @@
description
"Identifier for the VNFD.";
type leafref {
- path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
+ path "../../../constituent-vnfd" +
+ "[member-vnf-index = current()/../member-vnf-index-ref]" +
+ "/vnfd-id-ref";
}
}
}
@@ -621,14 +627,14 @@
key vnf-source-ref;
leaf vnf-source-ref {
type leafref {
- path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
+ path "../../constituent-vnfd/vnfd-id-ref";
}
}
leaf vnf-depends-on-ref {
description
"Reference to VNF that sorce VNF depends.";
type leafref {
- path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
+ path "../../constituent-vnfd/vnfd-id-ref";
}
}
}
@@ -720,7 +726,11 @@
to leafref, whose target is in a different module.
Once that is resovled this will switched to use
leafref";
- type string;
+ type leafref {
+ path "../../../../constituent-vnfd" +
+ "[member-vnf-index = current()/../member-vnf-index-ref]" +
+ "/vnfd-id-ref";
+ }
}
leaf vnfd-connection-point-ref {
@@ -735,7 +745,11 @@
to leafref, whose target is in a different module.
Once that is resovled this will switched to use
leafref";
- type string;
+ type leafref {
+ path "/vnfd:vnfd-catalog/vnfd:vnfd" +
+ "[vnfd:id = current()/../vnfd-id-ref]/" +
+ "vnfd:connection-point/vnfd:name";
+ }
}
}
} //rsp
@@ -785,7 +799,11 @@
to leafref, whose target is in a different module.
Once that is resovled this will switched to use
leafref";
- type string;
+ type leafref {
+ path "../../../constituent-vnfd" +
+ "[member-vnf-index = current()/../member-vnf-index-ref]" +
+ "/vnfd-id-ref";
+ }
}
leaf vnfd-connection-point-ref {
@@ -800,7 +818,11 @@
to leafref, whose target is in a different module.
Once that is resovled this will switched to use
leafref";
- type string;
+ type leafref {
+ path "/vnfd:vnfd-catalog/vnfd:vnfd" +
+ "[vnfd:id = current()/../vnfd-id-ref]/" +
+ "vnfd:connection-point/vnfd:name";
+ }
}
list match-attributes {
@@ -869,7 +891,7 @@
list vnfd-monitoring-param {
description "A list of VNFD monitoring params";
- key "vnfd-id-ref vnfd-monitoring-param-ref";
+ key "member-vnf-index-ref vnfd-monitoring-param-ref";
leaf vnfd-id-ref {
description
@@ -884,7 +906,11 @@
Once that is resolved this will switched to use
leafref";
- type yang:uuid;
+ type leafref {
+ path "../../../constituent-vnfd" +
+ "[member-vnf-index = current()/../member-vnf-index-ref]" +
+ "/vnfd-id-ref";
+ }
}
leaf vnfd-monitoring-param-ref {
@@ -896,10 +922,12 @@
}
}
- leaf-list member-vnf-index-ref {
- description
- "Optional reference to member-vnf within constituent-vnfds";
- type uint64;
+ leaf member-vnf-index-ref {
+ description
+ "Mandatory reference to member-vnf within constituent-vnfds";
+ type leafref {
+ path "../../../constituent-vnfd/member-vnf-index";
+ }
}
}
}
diff --git a/models/plugins/yang/vnfd.yang b/models/plugins/yang/vnfd.yang
index b700bc2..279a4b8 100644
--- a/models/plugins/yang/vnfd.yang
+++ b/models/plugins/yang/vnfd.yang
@@ -319,7 +319,7 @@
"Use the default management interface on this VDU.";
leaf vdu-id {
type leafref {
- path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:vdu/vnfd:id";
+ path "../../vdu/id";
}
}
}
@@ -329,7 +329,7 @@
"Use the ip address associated with this connection point.";
leaf cp {
type leafref {
- path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:connection-point/vnfd:name";
+ path "../../connection-point/name";
}
}
}