use of org.opendaylight.yangtools.yang.data.api.schema.tree.ModifiedNodeDoesNotExistException in project netvirt by opendaylight.
the class FibUtil method removeFibEntry.
@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;
}
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) {
if (e.getCause() instanceof ModifiedNodeDoesNotExistException) {
LOG.warn("removeFibEntry: Fib Entry prefix {} rd {} source {} is already deleted from the " + "vrf table.", prefix, rd, eventSource);
} else {
LOG.error("removeFibEntry: Unable to remove Fib Entry for rd {} prefix {} source {} ", rd, prefix, eventSource);
}
}
}
Aggregations