aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshrikantawachar <shrikant.awachar@amdocs.com>2018-03-13 18:58:28 +0530
committerAvi Gaffa <avi.gaffa@amdocs.com>2018-03-13 14:32:44 +0000
commit0f3a80869bf57fc909ec5908601ba04271d92d97 (patch)
tree261ec87f220c4930b5d4d1e94f016f317ab55237
parent6a924cf18fb4cd76ba6163b453278d0045b70e87 (diff)
Processing CSAR failed
The *.csar packages not passing onboarding during SDC sanity. Change-Id: I0fc57296bad85928c704dd1b18a7e60a996c13a9 Issue-ID: SDC-1124 Signed-off-by: shrikantawachar <shrikant.awachar@amdocs.com>
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/OrchestrationTemplateCandidateManagerImpl.java11
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateCandidateDaoZusammenImpl.java2
-rw-r--r--openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VspZusammenUtil.java14
3 files changed, 8 insertions, 19 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/OrchestrationTemplateCandidateManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/OrchestrationTemplateCandidateManagerImpl.java
index cfb4c9dbfd..9d36ad452b 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/OrchestrationTemplateCandidateManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/OrchestrationTemplateCandidateManagerImpl.java
@@ -25,8 +25,6 @@ import org.openecomp.sdc.common.errors.CoreException;
import org.openecomp.sdc.common.utils.CommonUtil;
import org.openecomp.sdc.common.utils.SdcCommon;
import org.openecomp.sdc.datatypes.error.ErrorMessage;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
import org.openecomp.sdc.logging.api.annotations.Metrics;
import org.openecomp.sdc.vendorsoftwareproduct.OrchestrationTemplateCandidateManager;
import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao;
@@ -48,12 +46,12 @@ import java.io.InputStream;
import java.util.Collections;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import java.util.Optional;
public class OrchestrationTemplateCandidateManagerImpl
implements OrchestrationTemplateCandidateManager {
- private static final Logger LOGGER =
- LoggerFactory.getLogger(OrchestrationTemplateCandidateManagerImpl.class);
+
private final VendorSoftwareProductInfoDao vspInfoDao;
private final CandidateService candidateService;
@@ -126,6 +124,11 @@ public class OrchestrationTemplateCandidateManagerImpl
if (!candidateDataEntity.isPresent()) {
return Optional.empty();
}
+
+ if(Objects.isNull(candidateDataEntity.get().getFileSuffix())) {
+ return Optional.empty();
+ }
+
OnboardingTypesEnum type =
OnboardingTypesEnum.getOnboardingTypesEnum(candidateDataEntity.get().getFileSuffix());
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateCandidateDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateCandidateDaoZusammenImpl.java
index b72d684065..22fe1dd98c 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateCandidateDaoZusammenImpl.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateCandidateDaoZusammenImpl.java
@@ -72,7 +72,7 @@ public class OrchestrationTemplateCandidateDaoZusammenImpl
zusammenAdaptor.getElementByName(context, elementContext, null,
ElementType.OrchestrationTemplateCandidate.name());
if (candidateElement.isPresent()) {
- if (VspZusammenUtil.isEmpty(candidateElement.get().getData())) {
+ if (VspZusammenUtil.hasEmptyData(candidateElement.get().getData())) {
return null;
}
OrchestrationTemplateCandidateData candidateData = new OrchestrationTemplateCandidateData();
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VspZusammenUtil.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VspZusammenUtil.java
index 09fd948030..da2232450a 100644
--- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VspZusammenUtil.java
+++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VspZusammenUtil.java
@@ -2,7 +2,6 @@ package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen;
import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.ArrayUtils;
import java.io.IOException;
import java.io.InputStream;
@@ -30,19 +29,6 @@ class VspZusammenUtil {
return head;
}
- static boolean isEmpty(InputStream elementData) {
- byte[] byteElementData;
- if (Objects.isNull(elementData)) {
- return true;
- }
- try {
- byteElementData = IOUtils.toByteArray(elementData);
- } catch (IOException e) {
- return false;
- }
- return ArrayUtils.isEmpty(byteElementData);
- }
-
static boolean hasEmptyData(InputStream elementData) {
String EMPTY_DATA = "{}";
byte[] byteElementData;