From 32159795628720b76a8ed789f632f9fa68b41603 Mon Sep 17 00:00:00 2001 From: MichaelMorris Date: Fri, 3 Jun 2022 16:09:46 +0100 Subject: Retry fetch assettoscatemplate in csar generation Change-Id: I328e174d34b1c8fb688510b498d50130827b9608 Issue-ID: SDC-4032 Signed-off-by: MichaelMorris --- .../src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'catalog-be/src/main/java/org') diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java index 9b0b25b250..81d9e5d077 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java @@ -432,6 +432,7 @@ public class CsarUtils { boolean isInCertificationRequest) throws IOException { ArtifactDefinition artifactDef = component.getToscaArtifacts().get(ToscaExportHandler.ASSET_TOSCA_TEMPLATE); Either toscaRepresentation = fetchToscaRepresentation(component, getFromCS, artifactDef); + // This should not be done but in order to keep the refactoring small enough we stop here. // TODO: Refactor the rest of this function @@ -879,10 +880,10 @@ public class CsarUtils { return Either.right(componentsUtils.getResponseFormat(ActionStatus.TOSCA_SCHEMA_FILES_NOT_FOUND, firstThreeOctets, CONFORMANCE_LEVEL)); } - private Either getFromCassandra(String cassandraId) { - return artifactCassandraDao.getArtifact(cassandraId).right().map(cos -> { - log.debug("Failed to fetch artifact from Cassandra by id {} error {} ", cassandraId, cos); - StorageOperationStatus storageStatus = DaoStatusConverter.convertCassandraStatusToStorageStatus(cos); + private Either getFromCassandra(String cassandraId) { + return artifactCassandraDao.getArtifact(cassandraId).right().map(operationstatus -> { + log.info("Failed to fetch artifact from Cassandra by id {} error {}.", cassandraId, operationstatus); + StorageOperationStatus storageStatus = DaoStatusConverter.convertCassandraStatusToStorageStatus(operationstatus); return componentsUtils.convertFromStorageResponse(storageStatus); }).left().map(DAOArtifactData::getDataAsArray); } -- cgit 1.2.3-korg