Add some debugging for vlan case 87/20387/1
authorSam Hague <shague@redhat.com>
Thu, 14 May 2015 14:25:24 +0000 (10:25 -0400)
committerSam Hague <shague@redhat.com>
Thu, 14 May 2015 14:25:24 +0000 (10:25 -0400)
Change-Id: Ib84d1f73da44364a9648209eef45ccef6c3173ec
Signed-off-by: Sam Hague <shague@redhat.com>
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/OF13Provider.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/MdsalUtils.java

index 9e6dd07dccb653fd32740d2eea953344b48458e1..fd0034995f440f92dea389d560051a9f09ca3a9d 100644 (file)
@@ -930,10 +930,11 @@ public class OF13Provider implements NetworkingProvider {
             return;
         }
 
+        String phyIfName =
+                bridgeConfigurationManager.getPhysicalInterfaceName(node, network.getProviderPhysicalNetwork());
         List<OvsdbTerminationPointAugmentation> intfs = MdsalUtils.getTerminationPointsOfBridge(node);
         for (OvsdbTerminationPointAugmentation ethIntf : intfs) {
-            if (ethIntf.getName().equalsIgnoreCase(bridgeConfigurationManager.getPhysicalInterfaceName(
-                    node, network.getProviderPhysicalNetwork()))) {
+            if (ethIntf.getName().equals(phyIfName)) {
                 long ethOFPort = MdsalUtils.getOFPort(ethIntf);
                 if (ethOFPort == 0) {
                     logger.warn("programVlanRules: could not find ofPort for physical port");
@@ -947,6 +948,9 @@ public class OF13Provider implements NetworkingProvider {
                 programLocalIngressVlanRules(node, dpid, network.getProviderSegmentationID(),
                         attachedMac, localPort, ethOFPort);
                 return;
+            } else {
+                logger.debug("programVlanRules: intf {} does not match phyIfName: {}",
+                        ethIntf.getName(), phyIfName);
             }
         }
     }
@@ -1006,9 +1010,6 @@ public class OF13Provider implements NetworkingProvider {
         Preconditions.checkNotNull(nodeCacheManager);
         Map<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId,Node> nodes =
                 nodeCacheManager.getOvsdbNodes();
-        //OvsdbBridgeAugmentation bridgeAugmentation = srcNode.getAugmentation(OvsdbBridgeAugmentation.class);
-        //@SuppressWarnings("unchecked")
-        //InstanceIdentifier<Node> ovsdbNodeIid = (InstanceIdentifier<Node>) (bridgeAugmentation.getManagedBy().getValue());
         nodes.remove(MdsalUtils.extractBridgeOvsdbNodeId(srcNode));
         String networkType = network.getProviderNetworkType();
         String segmentationId = network.getProviderSegmentationID();
index 75261dd0c1724a989ff90167ae97f2ae4316079d..641115b1f67c980c14ab37fac92ce47825c80e1e 100644 (file)
@@ -20,12 +20,9 @@ import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
 import org.opendaylight.ovsdb.openstack.netvirt.api.OvsdbTables;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.InterfaceTypeInternal;
 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.OvsdbBridgeAugmentationBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeName;
@@ -52,14 +49,12 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.re
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.PortOtherConfigs;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
 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.TpId;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointBuilder;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -215,17 +210,19 @@ public class MdsalUtils {
         OvsdbNodeAugmentation nodeAugmentation = null;
         OvsdbBridgeAugmentation bridgeAugmentation = extractBridgeAugmentation(bridgeNode);
         if(bridgeAugmentation != null){
-            InstanceIdentifier<Node> ovsdbNodeIid = (InstanceIdentifier<Node>) bridgeAugmentation.getManagedBy().getValue();
+            InstanceIdentifier<Node> ovsdbNodeIid =
+                    (InstanceIdentifier<Node>) bridgeAugmentation.getManagedBy().getValue();
             Node node = read(LogicalDatastoreType.OPERATIONAL, ovsdbNodeIid);
             if (node != null){
                 nodeAugmentation = node.getAugmentation(OvsdbNodeAugmentation.class);
-                LOG.debug("Ovsdb node {} found that manages bridge {}", nodeAugmentation != null?nodeAugmentation:"not",bridgeAugmentation);
+                LOG.debug("readOvsdbNode: Ovsdb node {} found that manages bridge {}",
+                        nodeAugmentation != null?nodeAugmentation:"not",bridgeAugmentation);
             }else {
-                LOG.debug ("Ovsdb node that manages bridge {} not found. ",bridgeAugmentation);
+                LOG.debug ("readOvsdbNode: Ovsdb node that manages bridge {} not found. ",bridgeAugmentation);
             }
 
         }else{
-            LOG.debug("Provided node is not a bridge node : {}",bridgeNode);
+            LOG.debug("readOvsdbNode: Provided node is not a bridge node : {}",bridgeNode);
         }
         return nodeAugmentation;
     }
@@ -258,7 +255,7 @@ public class MdsalUtils {
             throws InterruptedException, InvalidParameterException {
         boolean result = false;
 
-        LOG.info("Add Bridge: node: {}, bridgeName: {}, target: {}", ovsdbNode, bridgeName, target);
+        LOG.info("addBridge: node: {}, bridgeName: {}, target: {}", ovsdbNode, bridgeName, target);
         ConnectionInfo connectionInfo = getConnectionInfo(ovsdbNode);
         if (connectionInfo != null) {
             NodeBuilder bridgeNodeBuilder = new NodeBuilder();
@@ -289,7 +286,7 @@ public class MdsalUtils {
                 MdsalHelper.createInstanceIdentifier(ovsdbNode.getNodeId());
 
         result = delete(LogicalDatastoreType.CONFIGURATION, bridgeIid);
-        LOG.info("Delete bridge node: {}, bridgeName: {} result : {}", ovsdbNode, ovsdbNode.getNodeId(),result);
+        LOG.info("deleteBridge node: {}, bridgeName: {} result : {}", ovsdbNode, ovsdbNode.getNodeId(),result);
         return result;
     }
 
@@ -611,7 +608,7 @@ public class MdsalUtils {
             }
             break;
         case CONTROLLER:
-            LOG.debug("There is no external_id for OvsdbTables: ", table);
+            LOG.warn("getExternalId: There is no external_id for OvsdbTables: ", table);
             return null;
         case OPENVSWITCH:
             OvsdbNodeAugmentation ovsdbNode = extractNodeAugmentation(node);
@@ -636,7 +633,7 @@ public class MdsalUtils {
             }
             break;
         default:
-            LOG.debug("Couldn't find the specified OvsdbTables: ", table);
+            LOG.debug("getExternalId: Couldn't find the specified OvsdbTable: ", table);
             return null;
         }
         return null;
@@ -655,7 +652,7 @@ public class MdsalUtils {
                 }
                 break;
             case CONTROLLER:
-                LOG.debug("There is no other_config for OvsdbTables: ", table);
+                LOG.warn("getOtherConfig: There is no other_config for OvsdbTables: ", table);
                 return null;
 
             case OPENVSWITCH:
@@ -684,7 +681,7 @@ public class MdsalUtils {
                 }
                 break;
             default:
-                LOG.debug("Couldn't find the specified OvsdbTables: ", table);
+                LOG.debug("getOtherConfig: Couldn't find the specified OvsdbTable: ", table);
                 return null;
         }
         return null;