From 8a9734228ed8ad9b7e4bfe2486895647e20a5d77 Mon Sep 17 00:00:00 2001 From: "Kalkere Ramesh, Sharan" Date: Fri, 18 Dec 2020 14:51:22 -0500 Subject: skip delete heatbridge when multicloud orchestrator Issue-ID: SO-3431 Change-Id: I212a38ae39128f538441e71935336db82ebdf351 Signed-off-by: Kalkere Ramesh, Sharan --- .../org/onap/so/adapters/tasks/inventory/DeleteAAIInventory.java | 6 ++++++ .../main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'adapters') diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/DeleteAAIInventory.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/DeleteAAIInventory.java index f5a6355529..f904788de3 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/DeleteAAIInventory.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/DeleteAAIInventory.java @@ -48,10 +48,16 @@ public class DeleteAAIInventory { @Autowired protected Environment env; + private static final String MULTICLOUD_MODE = "MULTICLOUD"; + public void heatbridge(CloudInformation cloudInformation) throws MsoCloudSiteNotFound, HeatBridgeException { logger.debug("Heatbridge delete executing"); CloudSite cloudSite = cloudConfig.getCloudSite(cloudInformation.getRegionId()) .orElseThrow(() -> new MsoCloudSiteNotFound(cloudInformation.getRegionId())); + if (cloudSite.getOrchestrator() != null && MULTICLOUD_MODE.equalsIgnoreCase(cloudSite.getOrchestrator())) { + logger.debug("Skipping Heatbridge as CloudSite orchestrator is: " + MULTICLOUD_MODE); + return; + } CloudIdentity cloudIdentity = cloudSite.getIdentityService(); HeatBridgeApi heatBridgeClient = new HeatBridgeImpl(new AAIResourcesClient(), cloudIdentity, cloudInformation.getOwner(), cloudInformation.getRegionId(), cloudSite.getRegionId(), diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java index 6b979833eb..58c43be36a 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java @@ -1120,7 +1120,9 @@ public class MsoVnfPluginAdapterImpl { long subStartTime = System.currentTimeMillis(); try { // TODO: Get an appropriate timeout value - require access to the model - vduPlugin.deleteVdu(cloudInfo, vfModuleId, 5); + if (!vduInstance.getStatus().getState().equals(VduStateType.NOTFOUND)) { + vduPlugin.deleteVdu(cloudInfo, vfModuleId, 5); + } } catch (VduException me) { me.addContext("DeleteVfModule"); // Convert to a generic VnfException -- cgit 1.2.3-korg