diff options
author | 2020-04-30 14:00:28 +0300 | |
---|---|---|
committer | 2020-04-30 14:49:57 +0000 | |
commit | 31c64b3443fb1a76d1cfc7afc0db1e51f1ffda79 (patch) | |
tree | d5458b68dcaf802208ca36829d6868861f761204 /openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java | |
parent | 8c5a1d6591d0faf2bdd0de528f42863ae1594c4f (diff) |
HEAT to TOSCA VM Consolidation
Change-Id: I00c9cf90d7486af33955acae7dfe653e14ceebdc
Issue-ID: SDC-2997
Signed-off-by: Ben David, Elad (eb7504) <eb7504@intl.att.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java')
-rw-r--r-- | openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationService.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationService.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationService.java index 28b265663e..b99bcf8bb8 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationService.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationService.java @@ -494,7 +494,18 @@ public class ConsolidationService { return true; } return !CommonUtil.isMultimapEmpty(firstEntityMap) && !CommonUtil.isMultimapEmpty(secondEntityMap) - && firstEntityMap.keySet().equals(secondEntityMap.keySet()); + && equalsIgnoreSuffix(new HashSet<>(firstEntityMap.keySet()),new HashSet<>(secondEntityMap.keySet())); + } + + private boolean equalsIgnoreSuffix(Set<String> firstKeySet, Set<String> secondKeySet){ + Set<String> firstKeySetTrimmed = firstKeySet.stream().map(this::trimSuffix).collect(Collectors.toSet()); + Set<String> secondKeySetTrimmed = secondKeySet.stream().map(this::trimSuffix).collect(Collectors.toSet()); + return firstKeySetTrimmed.equals(secondKeySetTrimmed); + } + + private String trimSuffix(String volumeName){ + int suffixPosition = volumeName.lastIndexOf("_"); + return volumeName.substring(0, suffixPosition); } private boolean checkGroupIdsRelations(EntityConsolidationData startingEntity, |