aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/java/org/openecomp
diff options
context:
space:
mode:
authorMichaelMorris <michael.morris@est.tech>2021-03-04 12:25:35 +0000
committerMichaelMorris <michael.morris@est.tech>2021-03-04 12:29:59 +0000
commit08a24bfbff3b1f830084fa23c8eb9f097e21db0b (patch)
treed36b230a07e622cd4841dcd00d788e5e59a80835 /catalog-be/src/main/java/org/openecomp
parentcc1258877c40690c43349351b4e6bdd5aa278553 (diff)
Fix issue with invariantUUID in exported tosca
Signed-off-by: MichaelMorris <michael.morris@est.tech> Issue-ID: SDC-3496 Change-Id: If12426466d2e9f8cfd97cef888f8a710e46afb01
Diffstat (limited to 'catalog-be/src/main/java/org/openecomp')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java
index 1f0270fee9..ab87b5e739 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java
@@ -143,6 +143,7 @@ import org.yaml.snakeyaml.representer.Representer;
public class ToscaExportHandler {
private static final Logger log = Logger.getLogger(ToscaExportHandler.class);
+ private static final String INVARIANT_UUID = "invariantUUID";
private ApplicationDataTypeCache dataTypeCache;
private ToscaOperationFacade toscaOperationFacade;
@@ -444,7 +445,7 @@ public class ToscaExportHandler {
private Map<String, String> convertMetadata(Component component, boolean isInstance,
ComponentInstance componentInstance) {
Map<String, String> toscaMetadata = new LinkedHashMap<>();
- toscaMetadata.put(JsonPresentationFields.INVARIANT_UUID.getPresentation(), component.getInvariantUUID());
+ toscaMetadata.put(convertMetadataKey(JsonPresentationFields.INVARIANT_UUID), component.getInvariantUUID());
toscaMetadata.put(JsonPresentationFields.UUID.getPresentation(), component.getUUID());
toscaMetadata
.put(JsonPresentationFields.NAME.getPresentation(), component.getComponentMetadataDefinition().getMetadataDataDefinition().getName());
@@ -515,6 +516,13 @@ public class ToscaExportHandler {
}
return toscaMetadata;
}
+
+ private String convertMetadataKey(JsonPresentationFields jsonPresentationField) {
+ if (JsonPresentationFields.INVARIANT_UUID.equals(jsonPresentationField)) {
+ return INVARIANT_UUID;
+ }
+ return jsonPresentationField.getPresentation();
+ }
private Either<ImmutablePair<ToscaTemplate, Map<String, Component>>, ToscaError> fillImports(Component component,
ToscaTemplate toscaTemplate) {