Subnet route is not advertised to FIB table...
[netvirt.git] / fibmanager / impl / src / main / java / org / opendaylight / netvirt / fibmanager / FibUtil.java
index 95f0f1977bb2714e33d150716c757add8f2968ef..342fb785b25d2b9f020e7a776c753f0964442f6e 100644 (file)
@@ -372,25 +372,34 @@ public class FibUtil {
         builder.setRoutePaths(routePaths);
     }
 
-    public void removeFibEntry(String rd, String prefix, TypedWriteTransaction<Configuration> writeConfigTxn) {
+    @SuppressWarnings("checkstyle:IllegalCatch")
+    public void removeFibEntry(String rd, String prefix, String eventSource,
+                               TypedWriteTransaction<Configuration> writeConfigTxn) {
 
         if (rd == null || rd.isEmpty()) {
             LOG.error("Prefix {} not associated with vpn", prefix);
             return;
         }
-        LOG.debug("removeFibEntry: Removing fib entry with destination prefix {} from vrf table for rd {}",
-                prefix, rd);
-
-        InstanceIdentifier.InstanceIdentifierBuilder<VrfEntry> idBuilder =
-            InstanceIdentifier.builder(FibEntries.class)
-                .child(VrfTables.class, new VrfTablesKey(rd)).child(VrfEntry.class, new VrfEntryKey(prefix));
-        InstanceIdentifier<VrfEntry> vrfEntryId = idBuilder.build();
-        if (writeConfigTxn != null) {
-            writeConfigTxn.delete(vrfEntryId);
-        } else {
-            MDSALUtil.syncDelete(dataBroker, LogicalDatastoreType.CONFIGURATION, vrfEntryId);
+        try {
+            LOG.debug("removeFibEntry: Removing fib entry with destination prefix {} from vrf table for rd {}",
+                    prefix, rd);
+
+            InstanceIdentifier.InstanceIdentifierBuilder<VrfEntry> idBuilder =
+                    InstanceIdentifier.builder(FibEntries.class)
+                            .child(VrfTables.class, new VrfTablesKey(rd)).child(VrfEntry.class,
+                            new VrfEntryKey(prefix));
+            InstanceIdentifier<VrfEntry> vrfEntryId = idBuilder.build();
+            if (writeConfigTxn != null) {
+                writeConfigTxn.delete(vrfEntryId);
+            } else {
+                MDSALUtil.syncDelete(dataBroker, LogicalDatastoreType.CONFIGURATION, vrfEntryId);
+            }
+            LOG.error("removeFibEntry: Removed Fib Entry rd {} prefix {} source {} ",
+                    rd, prefix, eventSource);
+        } catch (RuntimeException e) {
+            LOG.error("removeFibEntry: Unable to remove Fib Entry for rd {} prefix {} source {} ",
+                    rd, prefix, eventSource);
         }
-        LOG.info("removeFibEntry: Removed Fib Entry rd {} prefix {}",rd, prefix);
     }
 
     /**
@@ -403,7 +412,6 @@ public class FibUtil {
      */
     public void removeOrUpdateFibEntry(String rd, String prefix, String nextHopToRemove,
             TypedWriteTransaction<Configuration> writeConfigTxn) {
-
         LOG.debug("Removing fib entry with destination prefix {} from vrf table for rd {} nextHop {}", prefix, rd,
                 nextHopToRemove);