aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-model
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2021-09-01 17:37:19 +0100
committerMichael Morris <michael.morris@est.tech>2021-09-03 14:14:19 +0000
commit9534496497b037f4bfb26603f91b54f41e65774a (patch)
tree896ff1751242d4e7b20d8f184735b002be9e2b6b /catalog-model
parent84e478592488c8bcbc01b820b3862ce0d839a7bd (diff)
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 <andre.schmid@est.tech>
Diffstat (limited to 'catalog-model')
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ModelOperation.java7
1 files changed, 7 insertions, 0 deletions
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;
}