aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYulian Han <elaine.hanyulian@huawei.com>2018-11-09 21:34:38 +0800
committerYulian Han <elaine.hanyulian@huawei.com>2018-11-09 21:34:38 +0800
commita2e9ad5d9b34d764493951737ab73821b03bba0c (patch)
treef74cd85c25ae25678ad70c6b7d85851e9b718013
parent047436d7967e91434b7ea19e060e8409baa876a6 (diff)
fix installing VL resource bug
Change-Id: Idaa55084f5ecb0dd3636c232cebc14fa5f064406 Issue-ID: SO-1184 Signed-off-by: Yulian Han <elaine.hanyulian@huawei.com>
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java73
1 files changed, 41 insertions, 32 deletions
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
index 06da4e7e03..c8f7f05436 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java
@@ -347,38 +347,47 @@ public class ToscaResourceInstaller {
}
}
- protected void processNetworks(ToscaResourceStructure toscaResourceStruct, Service service)
- throws ArtifactInstallerException {
- List<NodeTemplate> nodeTemplatesVLList = toscaResourceStruct.getSdcCsarHelper().getServiceVlList();
-
- if (nodeTemplatesVLList != null) {
- for (NodeTemplate vlNode : nodeTemplatesVLList) {
- String networkResourceModelName = vlNode.getMetaData()
- .getValue(SdcPropertyNames.PROPERTY_NAME_NAME);
-
- TempNetworkHeatTemplateLookup tempNetworkLookUp = tempNetworkLookupRepo.findFirstBynetworkResourceModelName(networkResourceModelName);
-
- if (tempNetworkLookUp != null ) {
- HeatTemplate heatTemplate = heatRepo.findByArtifactUuid(tempNetworkLookUp.getHeatTemplateArtifactUuid());
- if (heatTemplate != null ) {
- NetworkResourceCustomization networkCustomization = createNetwork(vlNode, toscaResourceStruct, heatTemplate,tempNetworkLookUp.getAicVersionMax(),
- tempNetworkLookUp.getAicVersionMin(),service);
- service.getNetworkCustomizations()
- .add(networkCustomization);
- }
- else{
- throw new ArtifactInstallerException(
- "No HeatTemplate found for artifactUUID: "
- + tempNetworkLookUp.getHeatTemplateArtifactUuid());
- }
- } else {
- throw new ArtifactInstallerException(
- "No NetworkResourceName found in TempNetworkHeatTemplateLookup for "
- + networkResourceModelName);
- }
-
- }
- }
+ protected void processNetworks (ToscaResourceStructure toscaResourceStruct,
+ Service service) throws ArtifactInstallerException {
+ List <NodeTemplate> nodeTemplatesVLList = toscaResourceStruct.getSdcCsarHelper ().getServiceVlList ();
+
+ if (nodeTemplatesVLList != null) {
+ for (NodeTemplate vlNode : nodeTemplatesVLList) {
+ String networkResourceModelName = vlNode.getMetaData ().getValue (SdcPropertyNames.PROPERTY_NAME_NAME);
+
+ TempNetworkHeatTemplateLookup tempNetworkLookUp =
+ tempNetworkLookupRepo.findFirstBynetworkResourceModelName (networkResourceModelName);
+
+ if (tempNetworkLookUp != null) {
+ HeatTemplate heatTemplate =
+ heatRepo.findByArtifactUuid (tempNetworkLookUp.getHeatTemplateArtifactUuid ());
+ if (heatTemplate != null) {
+ NetworkResourceCustomization networkCustomization =
+ createNetwork (vlNode,
+ toscaResourceStruct,
+ heatTemplate,
+ tempNetworkLookUp.getAicVersionMax (),
+ tempNetworkLookUp.getAicVersionMin (),
+ service);
+ service.getNetworkCustomizations ().add (networkCustomization);
+ } else {
+ throw new ArtifactInstallerException ("No HeatTemplate found for artifactUUID: "
+ + tempNetworkLookUp.getHeatTemplateArtifactUuid ());
+ }
+ } else {
+ NetworkResourceCustomization networkCustomization = createNetwork (vlNode,
+ toscaResourceStruct,
+ null,
+ null,
+ null,
+ service);
+ service.getNetworkCustomizations().add (networkCustomization);
+ logger.debug ("No NetworkResourceName found in TempNetworkHeatTemplateLookup for "
+ + networkResourceModelName);
+ }
+
+ }
+ }
}
protected void processAllottedResources(ToscaResourceStructure toscaResourceStruct, Service service,