summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/java/org
diff options
context:
space:
mode:
authorKrupaNagabhushan <krupa.nagabhushan@est.tech>2021-07-30 11:02:06 +0100
committerKrupa Nagabhushan <krupa.nagabhushan@est.tech>2021-07-30 11:34:46 +0000
commitfed417ad58c84e4cbfe2f6df685ba869ba1e5cc7 (patch)
tree108589e08988a6ce220075596d6ca4463324e37a /catalog-be/src/main/java/org
parent89fe88168e2a1284e2e2b2601de4c65decd8f988 (diff)
Fix init upgrade fail for polictyTypes
Issue-ID: SDC-3658 Signed-off-by: KrupaNagabhushan <krupa.nagabhushan@est.tech> Change-Id: I13a0d97c543213bda289157f602b019c74811cbc
Diffstat (limited to 'catalog-be/src/main/java/org')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CommonImportManager.java3
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/impl/ComponentsUtils.java27
2 files changed, 30 insertions, 0 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CommonImportManager.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CommonImportManager.java
index 8c309bd835..b4e1594a41 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CommonImportManager.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CommonImportManager.java
@@ -180,6 +180,9 @@ public class CommonImportManager {
case GROUP_TYPE:
ret = componentsUtils.convertFromStorageResponseForGroupType(status);
break;
+ case POLICY_TYPE:
+ ret = componentsUtils.convertFromStorageResponseForPolicyType(status);
+ break;
case DATA_TYPE:
ret = componentsUtils.convertFromStorageResponseForDataType(status);
break;
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/impl/ComponentsUtils.java b/catalog-be/src/main/java/org/openecomp/sdc/be/impl/ComponentsUtils.java
index 8451caba27..607497ca26 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/impl/ComponentsUtils.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/impl/ComponentsUtils.java
@@ -1311,6 +1311,33 @@ public class ComponentsUtils {
return responseEnum;
}
+ public ActionStatus convertFromStorageResponseForPolicyType(StorageOperationStatus storageResponse) {
+ ActionStatus responseEnum;
+ switch (storageResponse) {
+ case OK:
+ responseEnum = ActionStatus.OK;
+ break;
+ case CONNECTION_FAILURE:
+ case GRAPH_IS_LOCK:
+ responseEnum = ActionStatus.GENERAL_ERROR;
+ break;
+ case BAD_REQUEST:
+ responseEnum = ActionStatus.INVALID_CONTENT;
+ break;
+ case ENTITY_ALREADY_EXISTS:
+ responseEnum = ActionStatus.POLICY_TYPE_ALREADY_EXIST;
+ break;
+ case SCHEMA_VIOLATION:
+ responseEnum = ActionStatus.POLICY_TYPE_ALREADY_EXIST;
+ break;
+ default:
+ responseEnum = ActionStatus.GENERAL_ERROR;
+ break;
+ }
+ log.debug(CONVERT_STORAGE_RESPONSE_TO_ACTION_RESPONSE, storageResponse, responseEnum);
+ return responseEnum;
+ }
+
public ActionStatus convertFromStorageResponseForDataType(StorageOperationStatus storageResponse) {
ActionStatus responseEnum;
switch (storageResponse) {