From 595dc75821d0d45c4231ca4b6047e5fc7cdbc772 Mon Sep 17 00:00:00 2001 From: Tomas Cechvala Date: Fri, 9 Dec 2016 14:04:56 +0100 Subject: [PATCH] Deleting L2 when removing interface from BD Errors when removing bridge-domain from bridge-based since bridge-domain is marked as mandatory. I tried to set interconnection to null, but this led to strange behaviour on HC, so currently it's necessary to remove the entire L2 node. Change-Id: I8c5738003fed464e89b346953c156c17d60e8d05 Signed-off-by: Tomas Cechvala --- .../renderer/vpp/iface/InterfaceManager.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/renderers/vpp/src/main/java/org/opendaylight/groupbasedpolicy/renderer/vpp/iface/InterfaceManager.java b/renderers/vpp/src/main/java/org/opendaylight/groupbasedpolicy/renderer/vpp/iface/InterfaceManager.java index 23130f6cd..bba5f19e4 100644 --- a/renderers/vpp/src/main/java/org/opendaylight/groupbasedpolicy/renderer/vpp/iface/InterfaceManager.java +++ b/renderers/vpp/src/main/java/org/opendaylight/groupbasedpolicy/renderer/vpp/iface/InterfaceManager.java @@ -52,9 +52,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev161214.l2.base.attributes.Interconnection; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev161214.l2.base.attributes.interconnection.BridgeBased; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev161214.l2.base.attributes.interconnection.BridgeBasedBuilder; -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; -import org.opendaylight.yangtools.yang.binding.DataObject; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -410,11 +408,8 @@ public class InterfaceManager implements AutoCloseable { LOG.warn("Interface already not in bridge domain {} ", ifaceKey); return Futures.immediateFuture(null); } - BridgeBased bridgeBased = new BridgeBasedBuilder((BridgeBased) l2Builder.getInterconnection()).setBridgeDomain( - null).build(); - L2 l2 = l2Builder.setInterconnection(bridgeBased).build(); - final boolean transactionState = GbpNetconfTransaction.write(mountPoint, VppIidFactory.getL2ForInterfaceIid(ifaceKey), - l2, GbpNetconfTransaction.RETRY_COUNT); + final boolean transactionState = GbpNetconfTransaction.delete(mountPoint, + VppIidFactory.getL2ForInterfaceIid(ifaceKey), GbpNetconfTransaction.RETRY_COUNT); if (transactionState) { LOG.debug("Removing bridge domain from interface {}", VppIidFactory.getInterfaceIID(ifaceKey)); return Futures.immediateFuture(null); @@ -424,7 +419,6 @@ public class InterfaceManager implements AutoCloseable { LOG.warn(message); return Futures.immediateFailedFuture(new VppRendererProcessingException(message)); } - } private L2Builder readL2ForInterface(DataBroker mountpoint, InterfaceKey ifaceKey) { -- 2.36.6