summaryrefslogtreecommitdiffstats
path: root/catalog-be
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceImportManager.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceImportManager.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceImportManager.java
index 787bc3e2de..b1841e55d8 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceImportManager.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceImportManager.java
@@ -176,7 +176,7 @@ public class ResourceImportManager {
if (latestByName.isLeft()) {
throw new ByActionStatusComponentException(ActionStatus.COMPONENT_NAME_ALREADY_EXIST, resource.getName());
}
- } else {
+ } else if (!isCsarPresent(csarInfo)) {
final Either<Resource, StorageOperationStatus> component = toscaOperationFacade
.getComponentByNameAndVendorRelease(resource.getComponentType(), resource.getName(), resource.getVendorRelease(),
JsonParseFlagEnum.ParseAll);
@@ -210,6 +210,10 @@ public class ResourceImportManager {
return responsePair;
}
+ private boolean isCsarPresent(final CsarInfo csarInfo) {
+ return csarInfo != null && StringUtils.isNotEmpty(csarInfo.getCsarUUID());
+ }
+
private String getLatestCertifiedResourceId(Resource resource) {
Map<String, String> allVersions = resource.getAllVersions();
Double latestCertifiedVersion = 0.0;