From 35164bca07a6f6ad62d502dcf99b30a89bab8f61 Mon Sep 17 00:00:00 2001 From: KrupaNagabhushan Date: Thu, 28 Apr 2022 10:37:54 +0100 Subject: Fix check to restrict deletion for system deployed VFCs Issue-ID: SDC-3986 Signed-off-by: KrupaNagabhushan Change-Id: I4d0f91640f6603c5029a88cb902c959bc8522455 --- .../openecomp/sdc/be/components/impl/ResourceBusinessLogic.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'catalog-be') 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 e11dbb3b67..aa2ba31385 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 @@ -4225,10 +4225,6 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { return componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(resourceStatus.right().value()), ""); } Resource resource = resourceStatus.left().value(); - if (isComponentSystemDeployed(resource)) { - throw new ByActionStatusComponentException(ActionStatus.CANNOT_DELETE_SYSTEM_DEPLOYED_RESOURCES, ComponentTypeEnum.RESOURCE.getValue(), - resource.getName()); - } StorageOperationStatus result = StorageOperationStatus.OK; lockComponent(resourceId, resource, "Mark resource to delete"); try { @@ -4270,6 +4266,10 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { componentException(resourceStatus.right().value()); } Resource resource = resourceStatus.left().value(); + if (isComponentSystemDeployed(resource)) { + throw new ByActionStatusComponentException(ActionStatus.CANNOT_DELETE_SYSTEM_DEPLOYED_RESOURCES, ComponentTypeEnum.RESOURCE.getValue(), + resource.getName()); + } if (Boolean.FALSE.equals(resource.isArchived())) { log.debug("The resource, {}, requested for delete has not been archived.", resourceId); throw new ComponentException(ActionStatus.COMPONENT_NOT_ARCHIVED, resourceId); -- cgit 1.2.3-korg