diff options
author | Yulian Han <elaine.hanyulian@huawei.com> | 2018-11-09 21:34:38 +0800 |
---|---|---|
committer | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2018-11-13 09:35:56 +0000 |
commit | d6047d4a1a499a828e607b7a67992cb394268b34 (patch) | |
tree | a6dce310552942c32f93fded94684c24ea85fb17 /asdc-controller/src/main/java | |
parent | 0f76551ead270d92d9933eab58d088e49b1e766c (diff) |
fix installing VL resource bug
Change-Id: Idaa55084f5ecb0dd3636c232cebc14fa5f064406
Issue-ID: SO-1184
Signed-off-by: Yulian Han <elaine.hanyulian@huawei.com>
(cherry picked from commit a2e9ad5d9b34d764493951737ab73821b03bba0c)
Diffstat (limited to 'asdc-controller/src/main/java')
-rw-r--r-- | asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java | 73 |
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, |