From 9534496497b037f4bfb26603f91b54f41e65774a Mon Sep 17 00:00:00 2001 From: "andre.schmid" Date: Wed, 1 Sep 2021 17:37:19 +0100 Subject: Fix CSAR generation default imports file conflict When generating a CSAR for a resource that is associated with a derived model, the default imports for the derived and parent model can conflict in path, therefore causing an issue during the CSAR zip generation which can't stand two entries with the same path. The fix adds a logic to rename a file when conflicting, by adding the model id as the file prefix. Change-Id: Ife7168f1c69f90be9c2cfd8ba75efad316c477f6 Issue-ID: SDC-3710 Signed-off-by: andre.schmid --- .../org/openecomp/sdc/be/model/operations/impl/ModelOperation.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'catalog-model') diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ModelOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ModelOperation.java index 967ffdc711..095b4e1cef 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ModelOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ModelOperation.java @@ -193,6 +193,13 @@ public class ModelOperation { } }); } + toscaImportByModelList.sort((o1, o2) -> { + final int modelIdComparison = o1.getModelId().compareTo(o2.getModelId()); + if (modelIdComparison == 0) { + return o1.getFullPath().compareTo(o2.getFullPath()); + } + return modelIdComparison; + }); return toscaImportByModelList; } -- cgit 1.2.3-korg