diff options
author | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2018-05-17 09:56:49 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-05-17 09:56:49 +0000 |
commit | c82216b0be5e2fab57031056d386a192b6abbce2 (patch) | |
tree | 304a79ac13a288b0dce0591de9e3b5a32f2a6221 /asdc-controller | |
parent | 77e3e0645cd638d80011d7ecb66a2b60ead86b2e (diff) | |
parent | 79a0dd38e0d1150e734d04e5ab999764a655af34 (diff) |
Merge "Fix resource population to DB"
Diffstat (limited to 'asdc-controller')
-rw-r--r-- | asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java | 43 |
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){
|