From 33e00cd1d7d580a2fdafad771d54e29bb455cb5d Mon Sep 17 00:00:00 2001 From: vempo Date: Tue, 3 Oct 2017 20:04:37 +0300 Subject: Update group members ids Issue-Id: SDC-427 Change-Id: If7a476adfac7c56c97e14330e4fddcc6d9f2d293 Signed-off-by: vempo --- .../sdc/heat/services/tree/HeatTreeManager.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'openecomp-be/lib/openecomp-heat-lib/src/main/java') diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManager.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManager.java index 372c09cffe..df46ef048d 100644 --- a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManager.java +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManager.java @@ -119,22 +119,19 @@ public class HeatTreeManager { } - private void handleHeatContentReference(String filename, HeatStructureTree fileHeatStructureTree, + private void handleHeatContentReference(HeatStructureTree fileHeatStructureTree, GlobalValidationContext globalContext) { String fileName = fileHeatStructureTree.getFileName(); - InputStream fileContent = this.heatContentMap.getFileContent(fileName); - if (fileContent == null) { - return; // file exist in manifest but does not exist in zip - } - try { + + try (InputStream fileContent = this.heatContentMap.getFileContent(fileName)) { HeatOrchestrationTemplate hot = new YamlUtil().yamlToObject(fileContent, HeatOrchestrationTemplate.class); - Set nestedSet = HeatTreeManagerUtil.getNestedFiles(filename, hot, globalContext); + Set nestedSet = HeatTreeManagerUtil.getNestedFiles(fileName, hot, globalContext); addHeatNestedFiles(fileHeatStructureTree, nestedSet); - Set artifactSet = HeatTreeManagerUtil.getArtifactFiles(filename, hot, globalContext); + Set artifactSet = HeatTreeManagerUtil.getArtifactFiles(fileName, hot, globalContext); addHeatArtifactFiles(fileHeatStructureTree, artifactSet); } catch (Exception ignore) { /* invalid yaml no need to process reference */ logger.debug("",ignore); @@ -224,7 +221,7 @@ public class HeatTreeManager { fileHeatStructureTree.setFileName(fileName); fileHeatStructureTree.setBase(fileData.getBase()); fileHeatStructureTree.setType(type); - handleHeatContentReference(null, fileHeatStructureTree, null); + handleHeatContentReference(fileHeatStructureTree, null); parentHeatStructureTree.addHeatToHeatList(fileHeatStructureTree); if (fileData.getData() != null) { scanTree(fileName, fileData.getData()); @@ -244,6 +241,7 @@ public class HeatTreeManager { if (fileData.getData() != null) { scanTree(fileName, fileData.getData()); } + handleHeatContentReference(childHeatStructureTree, null); } else if (FileData.Type.HEAT_VOL.equals(type)) { //parentHeatStructureTree.addVolumeFileToVolumeList(childHeatStructureTree); @@ -251,6 +249,7 @@ public class HeatTreeManager { if (fileData.getData() != null) { scanTree(fileName, fileData.getData()); } + handleHeatContentReference(childHeatStructureTree, null); } else if (FileData.Type.HEAT_ENV.equals(type)) { if (parentHeatStructureTree != null && parentHeatStructureTree.getFileName() != null) { parentHeatStructureTree.setEnv(childHeatStructureTree); -- cgit 1.2.3-korg