From 3de41b2429269dd3c79d286d136da667f2f143bc Mon Sep 17 00:00:00 2001 From: Maros Marsalek Date: Thu, 14 Apr 2016 15:22:06 +0200 Subject: 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 Signed-off-by: Marek Gradzki --- .../rev160406/InterfacesHoneycombWriterModule.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java') diff --git a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java index 4710d9e1a..e906167fd 100644 --- a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java +++ b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java @@ -8,12 +8,11 @@ import io.fd.honeycomb.v3po.translate.impl.write.CompositeRootWriter; import io.fd.honeycomb.v3po.translate.util.RWUtils; import io.fd.honeycomb.v3po.translate.util.write.CloseableWriter; import io.fd.honeycomb.v3po.translate.util.write.NoopWriterCustomizer; -import io.fd.honeycomb.v3po.translate.util.write.ReflexiveChildWriterCustomizer; +import io.fd.honeycomb.v3po.translate.util.write.ReflexiveAugmentWriterCustomizer; import io.fd.honeycomb.v3po.translate.v3po.interfaces.EthernetCustomizer; import io.fd.honeycomb.v3po.translate.v3po.interfaces.InterfaceCustomizer; import io.fd.honeycomb.v3po.translate.v3po.interfaces.L2Customizer; import io.fd.honeycomb.v3po.translate.v3po.interfaces.RoutingCustomizer; -import io.fd.honeycomb.v3po.translate.v3po.interfaces.VppInterfaceCustomizer; import io.fd.honeycomb.v3po.translate.v3po.interfaces.VxlanCustomizer; import io.fd.honeycomb.v3po.translate.v3po.interfaces.ip.Ipv4Customizer; import io.fd.honeycomb.v3po.translate.v3po.interfaces.ip.Ipv6Customizer; @@ -52,11 +51,15 @@ public class InterfacesHoneycombWriterModule extends org.opendaylight.yang.gen.v final List>> ifcAugmentations = Lists.newArrayList(); ifcAugmentations.add(getVppIfcAugmentationWriter()); + ifcAugmentations.add(getInterface1AugmentationWriter()); final ChildWriter interfaceWriter = new CompositeListWriter<>(Interface.class, RWUtils.emptyChildWriterList(), ifcAugmentations, - new InterfaceCustomizer(getVppJapiIfcDependency())); + new InterfaceCustomizer(getVppJapiIfcDependency()), + // It's important that this customizer is handled in a postorder way, because you first have to handle child nodes + // e.g. Vxlan before setting other interface or vppInterfaceAugmentation leaves + TraversalType.POSTORDER); final List>> childWriters = new ArrayList<>(); childWriters.add(interfaceWriter); @@ -79,7 +82,7 @@ public class InterfacesHoneycombWriterModule extends org.opendaylight.yang.gen.v interface1ChildWriters.add(ipv6Writer); return new CompositeChildWriter<>(Interface1.class, - interface1ChildWriters, new ReflexiveChildWriterCustomizer()); + interface1ChildWriters, new ReflexiveAugmentWriterCustomizer()); } private ChildWriter getVppIfcAugmentationWriter() { @@ -98,17 +101,14 @@ public class InterfacesHoneycombWriterModule extends org.opendaylight.yang.gen.v final List>> vppIfcChildWriters = Lists.newArrayList(); // TODO what's the order here ? - vppIfcChildWriters.add(ethernetWriter); vppIfcChildWriters.add(vxlanWriter); + vppIfcChildWriters.add(ethernetWriter); vppIfcChildWriters.add(l2Writer); vppIfcChildWriters.add(routingWriter); return new CompositeChildWriter<>(VppInterfaceAugmentation.class, vppIfcChildWriters, RWUtils.emptyAugWriterList(), - new VppInterfaceCustomizer(getVppJapiIfcDependency()), - // It's important that this customizer is handled in a postorder way, because you first have to handle child nodes - // e.g. Vxlan before setting other interface or vppInterfaceAugmentation leaves - TraversalType.POSTORDER); + new ReflexiveAugmentWriterCustomizer()); } } -- cgit 1.2.3-korg