summaryrefslogtreecommitdiffstats
path: root/lisp/lisp2vpp/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/lisp2vpp/src/main/java')
-rw-r--r--lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/ctx/GpeLocatorPairMappingContextImpl.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/ctx/GpeLocatorPairMappingContextImpl.java b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/ctx/GpeLocatorPairMappingContextImpl.java
index a7d84d2b6..766478fd5 100644
--- a/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/ctx/GpeLocatorPairMappingContextImpl.java
+++ b/lisp/lisp2vpp/src/main/java/io/fd/hc2vpp/lisp/gpe/translate/ctx/GpeLocatorPairMappingContextImpl.java
@@ -69,7 +69,11 @@ public class GpeLocatorPairMappingContextImpl implements GpeLocatorPairMappingCo
public void removeMapping(@Nonnull final String entryId,
@Nonnull final MappingContext mappingContext) {
LOG.debug("Removing all mappings for Gpe entry[id={}]", entryId);
- mappingContext.delete(getMappingId(entryId));
+ KeyedInstanceIdentifier<Mapping, MappingKey> mappingId = getMappingId(entryId);
+ // if no mapping present, no need to invoke delete(it would throw error because of non existing parent data)
+ if (mappingContext.read(mappingId).isPresent()) {
+ mappingContext.delete(mappingId);
+ }
LOG.debug("All mappings for Gpe entry[id={}] removed", entryId);
}