From 506cd385cb845fa334856c0e236a79b058c8eb35 Mon Sep 17 00:00:00 2001 From: zm330 Date: Thu, 22 Oct 2020 15:49:54 +0800 Subject: fix template parsing problems Issue-ID: SO-2963 Signed-off-by: zm330 Change-Id: I4eac0ddc5909076c4b83a7866b9a14a69e7b32c7 --- .../src/main/java/org/onap/so/asdc/client/ASDCController.java | 2 +- .../org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'asdc-controller/src') diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java index 44ea2a25a2..02b1df79dd 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java @@ -978,7 +978,7 @@ public class ASDCController { String artifactContent = null; List serviceArtifacts = iNotif.getServiceArtifacts(); Optional artifactOpt = serviceArtifacts.stream() - .filter(e -> e.getArtifactType().equalsIgnoreCase("OTHER")).findFirst(); + .filter(e -> e.getArtifactType().equalsIgnoreCase("WORKFLOW")).findFirst(); if (artifactOpt.isPresent()) { IArtifactInfo artifactInfo = artifactOpt.get(); logger.debug("Ready to parse this serviceArtifactUUID: " + artifactInfo.getArtifactUUID()); 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 49fef1d3f0..d57b305902 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 @@ -2913,15 +2913,19 @@ public class ToscaResourceInstaller { } private void createServiceArtifact(Service service, VfResourceStructure vfResourceStruct, String artifactContent) { + if (null == vfResourceStruct) { + return; + } List serviceArtifactList = new ArrayList<>(); ServiceArtifact serviceArtifact; List artifactInfoList = vfResourceStruct.getNotification().getServiceArtifacts().stream() - .filter(artifact -> artifact.getArtifactType().equalsIgnoreCase("OTHER")).collect(Collectors.toList()); + .filter(artifact -> artifact.getArtifactType().equalsIgnoreCase("WORKFLOW")) + .collect(Collectors.toList()); for (IArtifactInfo artifactInfo : artifactInfoList) { serviceArtifact = new ServiceArtifact(); serviceArtifact.setArtifactUUID(artifactInfo.getArtifactUUID()); serviceArtifact.setName(artifactInfo.getArtifactName()); - serviceArtifact.setType(artifactInfo.getArtifactType()); + serviceArtifact.setType("OTHER"); serviceArtifact.setVersion(artifactInfo.getArtifactVersion()); serviceArtifact.setDescription(artifactInfo.getArtifactDescription()); serviceArtifact.setChecksum(artifactInfo.getArtifactChecksum()); -- cgit 1.2.3-korg