From 35841a655443834474b48d94ae8b124d6f0896ff Mon Sep 17 00:00:00 2001 From: MichaelMorris Date: Tue, 24 Aug 2021 12:58:48 +0100 Subject: Fix service csar with model download failure Signed-off-by: MichaelMorris Issue-ID: SDC-3681 Change-Id: I824b38de5d0669db8aa3d47530fa02dcdf0d4871 --- .../openecomp/sdc/be/components/impl/ResourceBusinessLogic.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'catalog-be/src/main/java') diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java index 0e08be5d7a..c291c571d7 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java @@ -3372,9 +3372,10 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { if (nodeNamespaceMap.containsKey(uploadComponentInstanceInfo.getType())) { refResource = nodeNamespaceMap.get(uploadComponentInstanceInfo.getType()); } else { - Either findResourceEither = toscaOperationFacade - .getByToscaResourceNameMatchingVendorRelease(uploadComponentInstanceInfo.getType(), - ((ResourceMetadataDataDefinition) resource.getComponentMetadataDefinition().getMetadataDataDefinition()).getVendorRelease()); + Either findResourceEither = StringUtils.isEmpty(resource.getModel()) ? + toscaOperationFacade.getByToscaResourceNameMatchingVendorRelease(uploadComponentInstanceInfo.getType(), + ((ResourceMetadataDataDefinition) resource.getComponentMetadataDefinition().getMetadataDataDefinition()).getVendorRelease()): + toscaOperationFacade.getLatestByToscaResourceNameAndModel(uploadComponentInstanceInfo.getType(), resource.getModel()); if (findResourceEither.isRight()) { log.debug("validateResourceInstanceBeforeCreate - not found latest version for resource instance with name {} and type {}", uploadComponentInstanceInfo.getName(), uploadComponentInstanceInfo.getType()); -- cgit 1.2.3-korg