aboutsummaryrefslogtreecommitdiffstats
path: root/asdc-controller/src
diff options
context:
space:
mode:
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>2018-05-17 08:52:36 +0000
committersubhash kumar singh <subhash.kumar.singh@huawei.com>2018-05-17 08:52:36 +0000
commit79a0dd38e0d1150e734d04e5ab999764a655af34 (patch)
tree94096534f872c8c5306b5dc26ba70362b66ba00e /asdc-controller/src
parentfe588ed137686e562a2039c3d4901dbbd456c05f (diff)
Fix resource population to DB
Fix resource population to DB. Change-Id: Iae25ce2f15fa121a45a55559458fcbbd217f2c7d Issue-ID: SO-624 Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
Diffstat (limited to 'asdc-controller/src')
-rw-r--r--asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java43
1 files changed, 27 insertions, 16 deletions
diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java
index fc4e522877..a8c67fd96e 100644
--- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java
+++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java
@@ -596,23 +596,34 @@ public class ToscaResourceInstaller {// implements IVfResourceInstaller {
List<NodeTemplate> allottedResourceList = toscaResourceStruct.getSdcCsarHelper().getAllottedResources();
- if(allottedResourceList != null){
-
- for(NodeTemplate allottedNode : allottedResourceList){
-
- createAllottedResource(allottedNode, toscaResourceStruct);
-
- catalogDB.saveAllottedResource(toscaResourceStruct.getAllottedResource());
-
- catalogDB.saveAllottedResourceCustomization(toscaResourceStruct.getCatalogAllottedResourceCustomization());
-
- catalogDB.saveServiceToResourceCustomization(toscaResourceStruct.getCatalogAllottedServiceToResourceCustomization());
-
- }
- }
-
+ if(allottedResourceList != null){
+
+ for(NodeTemplate allottedNode : allottedResourceList){
+
+ createAllottedResource(allottedNode, toscaResourceStruct);
+
+ catalogDB.saveAllottedResource(toscaResourceStruct.getAllottedResource());
+
+ catalogDB.saveAllottedResourceCustomization(toscaResourceStruct.getCatalogAllottedResourceCustomization());
+
+ catalogDB.saveServiceToResourceCustomization(toscaResourceStruct.getCatalogAllottedServiceToResourceCustomization());
+
+ }
+ }
+
+ // handle VF resource
+ List<NodeTemplate> serviceVfList = toscaResourceStruct.getSdcCsarHelper().getServiceVfList();
+ if (serviceVfList != null) {
+ for (NodeTemplate vfNode : serviceVfList) {
+ createVnfResource(vfNode, toscaResourceStruct);
+ catalogDB.saveVnfResource(toscaResourceStruct.getCatalogVnfResource());
+ catalogDB.saveVnfResourceCustomization(toscaResourceStruct.getCatalogVnfResourceCustomization());
+ catalogDB.saveServiceToResourceCustomization(toscaResourceStruct.getCatalogVfServiceToResourceCustomization());
+ }
+ }
+
- List<NodeTemplate> nodeTemplatesVLList = toscaResourceStruct.getSdcCsarHelper().getServiceVlList();
+ List<NodeTemplate> nodeTemplatesVLList = toscaResourceStruct.getSdcCsarHelper().getServiceVlList();
if(nodeTemplatesVLList != null){