summaryrefslogtreecommitdiffstats
path: root/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/RoutingCustomizer.java
diff options
context:
space:
mode:
authorMaros Marsalek <mmarsale@cisco.com>2016-04-14 15:22:06 +0200
committerMarek Gradzki <mgradzki@cisco.com>2016-04-15 10:56:42 +0200
commit3de41b2429269dd3c79d286d136da667f2f143bc (patch)
treec0f9e3b0eae02ca195b0efb6cc8028b2c1482724 /v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/RoutingCustomizer.java
parent036a3589cfc1a62eddb49dc9cf09b7949c313f9b (diff)
HONEYCOMB-38: Fix vpp interface customizers
The order of execution was not correct + CompositeWriter ignored some changes Change-Id: I53fd9fda4b7a0379e0fa8451fa894865f67ebace Signed-off-by: Maros Marsalek <mmarsale@cisco.com> Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/RoutingCustomizer.java')
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/RoutingCustomizer.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/RoutingCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/RoutingCustomizer.java
index 8d930d80c..718afc0e1 100644
--- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/RoutingCustomizer.java
+++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/RoutingCustomizer.java
@@ -53,10 +53,9 @@ public class RoutingCustomizer extends VppApiCustomizer implements ChildWriterCu
public void writeCurrentAttributes(@Nonnull final InstanceIdentifier<Routing> id,
@Nonnull final Routing dataAfter, @Nonnull final Context writeContext)
throws WriteFailedException.CreateFailedException {
- final Interface ifc = (Interface) writeContext.get(InterfaceCustomizer.IFC_AFTER_CTX);
try {
- setRouting(ifc.getName(), dataAfter);
+ setRouting(id.firstKeyOf(Interface.class).getName(), dataAfter);
} catch (VppApiInvocationException e) {
LOG.warn("Update of Routing failed", e);
throw new WriteFailedException.CreateFailedException(id, dataAfter, e);
@@ -68,12 +67,10 @@ public class RoutingCustomizer extends VppApiCustomizer implements ChildWriterCu
@Nonnull final Routing dataBefore, @Nonnull final Routing dataAfter,
@Nonnull final Context writeContext)
throws WriteFailedException.UpdateFailedException {
- final Interface ifcBefore = (Interface) writeContext.get(InterfaceCustomizer.IFC_BEFORE_CTX);
- final Interface ifcAfter = (Interface) writeContext.get(InterfaceCustomizer.IFC_BEFORE_CTX);
try {
// TODO handle updates properly
- setRouting(ifcAfter.getName(), dataAfter);
+ setRouting(id.firstKeyOf(Interface.class).getName(), dataAfter);
} catch (VppApiInvocationException e) {
LOG.warn("Update of Routing failed", e);
throw new WriteFailedException.UpdateFailedException(id, dataBefore, dataAfter, e);