From fa9a707c87654330dfb5788a6029b8199c6cdf17 Mon Sep 17 00:00:00 2001 From: "Boslet, Cory" Date: Thu, 16 Apr 2020 10:43:38 -0400 Subject: move network adapter to an external client task Began impelenting new network external task. Made the vnfAdapterTask subflow an openstack subflow, refactored infra flows and BB to call it for network functions. Fixed bugs discovered through a robot dry run, added unit test, added support for rollback network request Updated junit test files for comparison due to not polling for response Removed the no longer used network adapter rest task from bpmn tasks Removed the unused network adapter async and its beans Removed network async client package from open pojo scan Issue-ID: SO-2813 Signed-off-by: Benjamin, Max (mb388a) Change-Id: I4c25892012cc86659ab122448ed1aca5cab91671 --- .../org/onap/so/openstack/utils/MsoHeatUtils.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'adapters/mso-adapter-utils/src/main/java/org') diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java index 62d9f068f9..c33160d255 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java +++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java @@ -184,6 +184,7 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin { if (CREATE_COMPLETE.equals(currentStack.getStackStatus())) { new StackInfoMapper(currentStack).map(); } else if (CREATE_IN_PROGRESS.equals(currentStack.getStackStatus())) { + // TODO should check poll for completion right here currentStack = processCreateStack(cloudSiteId, tenantId, timeoutMinutes, backout, currentStack, createStack, true); } else if (CREATE_FAILED.equals(currentStack.getStackStatus()) @@ -322,6 +323,27 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin { } } + public Stack postProcessStackUpdate(Stack updateStack) throws MsoOpenstackException { + if (!"UPDATE_COMPLETE".equals(updateStack.getStackStatus())) { + logger.error("{} Stack status: {} Stack status reason: {} {} Update Stack error", + MessageEnum.RA_UPDATE_STACK_ERR, updateStack.getStackStatus(), updateStack.getStackStatusReason(), + ErrorCode.DataError.getValue()); + + MsoOpenstackException me = null; + if ("UPDATE_IN_PROGRESS".equals(updateStack.getStackStatus())) { + me = new MsoOpenstackException(0, "", "Stack Update Timeout"); + } else { + String error = + "Stack error (" + updateStack.getStackStatus() + "): " + updateStack.getStackStatusReason(); + me = new MsoOpenstackException(0, "", error); + } + me.addContext("UpdateStack"); + throw me; + } else { + return updateStack; + } + } + public Stack pollStackForStatus(int timeoutMinutes, Stack stack, String stackStatus, String cloudSiteId, String tenantId, boolean notFoundIsSuccess) throws MsoException { int pollingFrequency = -- cgit 1.2.3-korg