From 82fdc597e0aa3d66481432d91a18646ed1fde1b7 Mon Sep 17 00:00:00 2001 From: Sam Hague Date: Wed, 13 May 2015 20:56:58 -0400 Subject: [PATCH] Allow terminationPoints to not need an interfaceType Change-Id: I3cb09cb16535fc5e23e3a5f976d0095a16208db2 Signed-off-by: Sam Hague --- .../transact/TerminationPointCreateCommand.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TerminationPointCreateCommand.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TerminationPointCreateCommand.java index 48cf0159c..d4ee1ac0b 100644 --- a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TerminationPointCreateCommand.java +++ b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TerminationPointCreateCommand.java @@ -26,6 +26,7 @@ import org.opendaylight.ovsdb.schema.openvswitch.Interface; import org.opendaylight.ovsdb.schema.openvswitch.Port; import org.opendaylight.ovsdb.southbound.SouthboundConstants; import org.opendaylight.ovsdb.southbound.SouthboundMapper; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.InterfaceTypeBase; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbPortInterfaceAttributes.VlanMode; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation; @@ -100,8 +101,8 @@ public class TerminationPointCreateCommand extends AbstractTransactCommand { final OvsdbTerminationPointAugmentation terminationPoint, final Interface ovsInterface) { ovsInterface.setName(terminationPoint.getName()); - ovsInterface.setType(SouthboundMapper.createOvsdbInterfaceType(terminationPoint.getInterfaceType())); + createInterfaceType(terminationPoint, ovsInterface); createOfPort(terminationPoint, ovsInterface); createOfPortRequest(terminationPoint, ovsInterface); createInterfaceOptions(terminationPoint, ovsInterface); @@ -109,6 +110,15 @@ public class TerminationPointCreateCommand extends AbstractTransactCommand { createInterfaceExternalIds(terminationPoint, ovsInterface); } + private void createInterfaceType(final OvsdbTerminationPointAugmentation terminationPoint, + final Interface ovsInterface) { + + Class mdsaltype = terminationPoint.getInterfaceType(); + if (mdsaltype != null) { + ovsInterface.setType(SouthboundMapper.createOvsdbInterfaceType(mdsaltype)); + } + } + private void createPort( final OvsdbTerminationPointAugmentation terminationPoint, final Port port, final String interfaceUuid) { -- 2.36.6