BUG 4678: Fixed Port map configuration with OpenStack Liberty 32/34532/1
authorananthip <ananthip@hcl.com>
Thu, 11 Feb 2016 12:56:32 +0000 (18:26 +0530)
committerSarath Babu Gurujala <sarathbg@hcl.com>
Fri, 12 Feb 2016 05:45:05 +0000 (05:45 +0000)
Change-Id: I36b4f2692aed5997792dc552bd839d31b15d733a
Signed-off-by: ananthip <ananthip@hcl.com>
(cherry picked from commit 6baea77be7a4c72df434d380fd262d355a7689bf)

manager/neutron/src/main/java/org/opendaylight/vtn/manager/neutron/impl/OVSDBEventHandler.java

index ecb89839afad2934e7262bee8b9da1ad52265972..00113a9a7dd28294fe4da9115d184dcab3a511b6 100644 (file)
@@ -682,8 +682,7 @@ public final class OVSDBEventHandler {
                             OfNode ofNode = toOfNode(
                                 bridgeNode.getDatapathId());
                             Long ofPort = port.getOfport();
-                            if (neutronPort != null && ofNode != null &&
-                                ofPort != null) {
+                            if (neutronPort != null && ofNode != null) {
                                 setPortMapForInterface(
                                     neutronPort, ofNode, ofPort, ovsPortName);
                             }
@@ -721,16 +720,29 @@ public final class OVSDBEventHandler {
             String tenantID = vtnIDs[0];
             String bridgeID = vtnIDs[1];
             String portID = vtnIDs[2];
-            SetPortMapInput input = new SetPortMapInputBuilder().
-                setTenantName(tenantID).
-                setBridgeName(bridgeID).
-                setInterfaceName(portID).
-                setNode(ofNode.getNodeId()).
-                setPortId(ofPort.toString()).
-                setPortName(portName).
-                setVlanId(vlanId).
-                build();
-            result = vtnManager.setPortMap(input);
+            if (ofPort != null) {
+                SetPortMapInput input = new SetPortMapInputBuilder().
+                        setTenantName(tenantID).
+                        setBridgeName(bridgeID).
+                        setInterfaceName(portID).
+                        setNode(ofNode.getNodeId()).
+                        setPortId(ofPort.toString()).
+                        setVlanId(vlanId).
+                        build();
+                result = vtnManager.setPortMap(input);
+            } else {
+                if (portName != null) {
+                    SetPortMapInput input = new SetPortMapInputBuilder().
+                            setTenantName(tenantID).
+                            setBridgeName(bridgeID).
+                            setInterfaceName(portID).
+                            setNode(ofNode.getNodeId()).
+                            setPortName(portName).
+                            setVlanId(vlanId).
+                            build();
+                    result = vtnManager.setPortMap(input);
+                }
+            }
         }
 
         return result;