skip delete heatbridge when multicloud orchestrator 65/116365/1
authorKalkere Ramesh, Sharan <sk720x@att.com>
Fri, 18 Dec 2020 19:51:22 +0000 (14:51 -0500)
committerLukasz Rajewski <lukasz.rajewski@orange.com>
Mon, 21 Dec 2020 07:43:10 +0000 (07:43 +0000)
Issue-ID: SO-3431
Change-Id: I212a38ae39128f538441e71935336db82ebdf351
Signed-off-by: Kalkere Ramesh, Sharan <sk720x@att.com>
(cherry picked from commit 8a9734228ed8ad9b7e4bfe2486895647e20a5d77)

adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/DeleteAAIInventory.java
adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java

index f5a6355..f904788 100644 (file)
@@ -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(),
index 6b97983..58c43be 100644 (file)
@@ -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