summaryrefslogtreecommitdiffstats
path: root/plugins/reception-plugins/src/main
diff options
context:
space:
mode:
authorliboNet <libo.zhu@intel.com>2018-11-10 05:32:42 +0800
committerliboNet <libo.zhu@intel.com>2018-11-13 02:02:07 +0800
commit370acda1a09a6fa4dc910869d7fb21f44626fe78 (patch)
treea1f1ce314c75d2cb910d4c8dfe81e267d6b0e7e3 /plugins/reception-plugins/src/main
parent789f09f2430440d6be44a5fad26715d002aff757 (diff)
Fix virtual_binding error under VDU requirements
virtual_binding will bind CP to a VDU but virtual_link use the node name instead of the name of node's propertiy add new test case to cover s3p the picvendorId's path has been changed based on demo repo Change-Id: I0ca400eab4d16284f14cb568fe3da5b409dd9222 Issue-ID: POLICY-1254 Signed-off-by: liboNet <libo.zhu@intel.com>
Diffstat (limited to 'plugins/reception-plugins/src/main')
-rw-r--r--plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/decoding/pdpx/ExtractFromNode.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/decoding/pdpx/ExtractFromNode.java b/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/decoding/pdpx/ExtractFromNode.java
index f2f27ce8..699ba49e 100644
--- a/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/decoding/pdpx/ExtractFromNode.java
+++ b/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/decoding/pdpx/ExtractFromNode.java
@@ -38,6 +38,7 @@ import org.onap.sdc.toscaparser.api.CapabilityAssignment;
import org.onap.sdc.toscaparser.api.CapabilityAssignments;
import org.onap.sdc.toscaparser.api.NodeTemplate;
import org.onap.sdc.toscaparser.api.RequirementAssignment;
+import org.onap.sdc.toscaparser.api.RequirementAssignments;
import org.onap.sdc.toscaparser.api.elements.Metadata;
/**
@@ -57,7 +58,8 @@ public class ExtractFromNode {
private static final String MEMORY_PAGE_SIZE_PATH = "virtual_memory#vdu_memory_requirements#memoryPageSize";
private static final String NETWORK_INTERFACE_TYPE_PATH =
"virtual_network_interface_requirements#network_interface_requirements#interfaceType";
- private static final String NETWORK_PCI_PATH = "virtual_network_interface_requirements#nic_io_requirements";
+ private static final String NETWORK_PCI_PATH =
+ "virtual_network_interface_requirements#nic_io_requirements#logical_node_requirements";
private static final String BASIC_CAPABILITIES_HPA_FEATURE = "BasicCapabilities";
private static final String HUGE_PAGES_HPA_FEATURE = "hugePages";
private static final Map<String, String> NETWORK_HPA_FEATURE_MAP =
@@ -132,7 +134,8 @@ public class ExtractFromNode {
flavorDirective.setType("flavor_directives");
flavorDirective.getAttributes().add(flavorAttribute);
final FlavorFeature flavorFeature = new FlavorFeature();
- flavorFeature.setId(sdcCsarHelper.getNodeTemplatePropertyLeafValue(node, "name"));
+ flavorFeature.setId(node.toString());
+ LOGGER.debug("the name of node =" + node.toString());
flavorFeature.getDirectives().add(flavorDirective);
final CapabilityAssignments capabilityAssignments = sdcCsarHelper.getCapabilitiesOf(node);
@@ -291,8 +294,10 @@ public class ExtractFromNode {
return;
}
- for (final RequirementAssignment requriement : sdcCsarHelper.getRequirementsOf(node).getAll()) {
- final String nodeTemplateName = requriement.getNodeTemplateName().toLowerCase();
+ final RequirementAssignments requriements =
+ sdcCsarHelper.getRequirementsOf(node).getRequirementsByName("virtual_binding");
+ for (final RequirementAssignment requriement : requriements.getAll()) {
+ final String nodeTemplateName = requriement.getNodeTemplateName();
LOGGER.debug("getNodeTemplateName =" + nodeTemplateName);
if (nodeTemplateName == null) {
continue;