handle tunnel port add/up event 30/70830/11
authorK.V Suneelu Verma <k.v.suneelu.verma@ericsson.com>
Thu, 12 Apr 2018 09:16:55 +0000 (14:46 +0530)
committerSam Hague <shague@redhat.com>
Wed, 30 May 2018 16:09:26 +0000 (16:09 +0000)
tunnel port is not a neutron port
do not put in port cache if it is tunnel port

dhcpManager.getNeutronPort(interfaceName) throws exception
when the supplied name is not a proper uuid.

in case of tunnel port port name is not a uuid

Change-Id: I34f4152a2c03e5eacd7f9410ff13eb3dccf63c47
Signed-off-by: K.V Suneelu Verma <k.v.suneelu.verma@ericsson.com>
dhcpservice/impl/src/main/java/org/opendaylight/netvirt/dhcpservice/DhcpInterfaceEventListener.java

index faf2e8d36a10228698e1603de4ba06b531072e8b..e015a0773a4b1446a98efbcd56dd6f24dd51bdf9 100644 (file)
@@ -100,12 +100,12 @@ public class DhcpInterfaceEventListener
             return;
         }
         if ((original.getOperStatus().getIntValue() ^ update.getOperStatus().getIntValue()) == 0) {
-            LOG.trace("Interface operstatus {} is same", update.getOperStatus());
+            LOG.trace("Interface operstatus is same orig {} updated {}", original, update);
             return;
         }
 
         if (original.getOperStatus().equals(OperStatus.Unknown) || update.getOperStatus().equals(OperStatus.Unknown)) {
-            LOG.trace("New/old interface state is unknown not handling");
+            LOG.trace("New/old interface state is unknown not handling orig {} updated {}", original, update);
             return;
         }
 
@@ -133,11 +133,13 @@ public class DhcpInterfaceEventListener
         if (ofportIds == null || ofportIds.isEmpty()) {
             return;
         }
-        Port port = dhcpManager.getNeutronPort(interfaceName);
-        if (NeutronConstants.IS_DHCP_PORT.test(port)) {
-            return;
+        if (!Tunnel.class.equals(add.getType())) {
+            Port port = dhcpManager.getNeutronPort(interfaceName);
+            if (NeutronConstants.IS_DHCP_PORT.test(port)) {
+                return;
+            }
+            dhcpPortCache.put(interfaceName, port);
         }
-        dhcpPortCache.put(interfaceName, port);
         NodeConnectorId nodeConnectorId = new NodeConnectorId(ofportIds.get(0));
         BigInteger dpnId = BigInteger.valueOf(MDSALUtil.getDpnIdFromPortName(nodeConnectorId));
         DhcpInterfaceAddJob job = new DhcpInterfaceAddJob(dhcpManager, dhcpExternalTunnelManager, dataBroker,