Remove openflow10
authorFlavio Fernandes <ffernand@redhat.com>
Fri, 6 Feb 2015 20:55:52 +0000 (15:55 -0500)
committerFlavio Fernandes <ffernand@redhat.com>
Fri, 6 Feb 2015 20:55:52 +0000 (15:55 -0500)
Follow up from https://git.opendaylight.org/gerrit/#/c/14968/
to remove dead code newly made.

Also re-enabled test in NeutronIT: testGetOpenflowVersion()

Change-Id: I705ab9e6046947c20349a2fb6906ca9d248e8085
Signed-off-by: Flavio Fernandes <ffernand@redhat.com>
integrationtest/src/test/java/org/opendaylight/ovsdb/integrationtest/neutron/NeutronIT.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/api/Constants.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/BridgeConfigurationManagerImpl.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/ConfigurationServiceImpl.java

index f0e10acf41487f0b6a8aabd9e37fc980b859faae..e5edde5fc501e4e77335cf0222cd133b72c18b3f 100644 (file)
@@ -42,7 +42,6 @@ import org.apache.felix.dm.DependencyManager;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.Configuration;
@@ -218,23 +217,13 @@ public class NeutronIT extends OvsdbIntegrationTestBase {
         Assert.assertNotEquals(ovsRow.getVersion(), originalVersion);
     }
 
-    // Note: The openFlow version is now determined by configuration's getProperty("ovsdb.of.version", "1.3").
-    // Thus, the ovs version attribute (returned by ovs' OpenVSwitch table) is not used to determine what is
-    // the openFlow version chosen by netVirtConfigurationService.
-    // See: https://git.opendaylight.org/gerrit/#/c/11084/
-    //      https://github.com/opendaylight/ovsdb/commit/2bc58c9cca16dc3e389cdfc18593578748fd52d5
-    @Ignore("netVirtConfigurationService.getOpenflowVersion(node) is not dependent on Constants.OPENFLOW13_SUPPORTED")
     @Test
     public void testGetOpenflowVersion() throws Exception {
         Thread.sleep(5000);
 
         Version ovsVersion = this.getOvsVersion();
-
-        if (ovsVersion.compareTo(Constants.OPENFLOW13_SUPPORTED) < 0) {
-            Assert.assertEquals(Constants.OPENFLOW10, netVirtConfigurationService.getOpenflowVersion(node));
-        } else {
-            Assert.assertEquals(Constants.OPENFLOW13, netVirtConfigurationService.getOpenflowVersion(node));
-        }
+        Assert.assertTrue(ovsVersion.compareTo(Constants.OPENFLOW13_SUPPORTED) >= 0);
+        Assert.assertEquals(Constants.OPENFLOW13, netVirtConfigurationService.getOpenflowVersion(node));
     }
 
     @Test
index acf7a9b496ea226320dd2d6a5aaf354b57171845..a38162ff5256cf6ab9b88c1db4fe4dd218325857 100644 (file)
@@ -44,7 +44,6 @@ public final class Constants {
     /*
      * OpenFlow Versions
      */
-    public static final String OPENFLOW10 = "OpenFlow10";
     public static final String OPENFLOW13 = "OpenFlow13";
     public static final Version OPENFLOW13_SUPPORTED = Version.fromString("1.10.0");
 
index adadf0cfde33b3b583ba56d48f2d5129545e50e2..e33895714acbbe761a664f2862e2590cf25d2c19 100644 (file)
@@ -651,11 +651,7 @@ public class BridgeConfigurationManagerImpl implements BridgeConfigurationManage
          */
 
         try {
-            if (!networkingProviderManager.getProvider(node).hasPerTenantTunneling()) {
-                protocols.add(Constants.OPENFLOW13);
-            } else {
-                protocols.add(Constants.OPENFLOW10);
-            }
+           protocols.add(Constants.OPENFLOW13);
             bridge.setProtocols(protocols);
         } catch (SchemaVersionMismatchException e) {
             logger.info(e.toString());
index 97f2e5fd0466c869aab5f0cf7c7e8ac931d40367..83611d912a2f5927e115e121825273063b36d7dc 100644 (file)
@@ -11,13 +11,11 @@ package org.opendaylight.ovsdb.openstack.netvirt.impl;
 
 import java.net.InetAddress;
 import java.util.Map;
-import java.util.Set;
 
 import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.apache.commons.lang3.tuple.Pair;
 import org.opendaylight.controller.sal.core.Node;
 import org.opendaylight.ovsdb.lib.notation.Row;
-import org.opendaylight.ovsdb.lib.notation.Version;
 import org.opendaylight.ovsdb.openstack.netvirt.api.ConfigurationService;
 import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
 import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
@@ -173,42 +171,6 @@ public class ConfigurationServiceImpl implements ConfigurationService {
 
     @Override
     public String getOpenflowVersion(Node node) {
-
-        String configuredVersion = ConfigProperties.getProperty(this.getClass(), "ovsdb.of.version", "1.3");
-        if (configuredVersion != null){
-            switch (configuredVersion){
-                case "1.0":
-                    return Constants.OPENFLOW10;
-                case "1.3":
-                    //fall through
-                default:
-                    return Constants.OPENFLOW13;
-
-            }
-        }
-
-        Map<String, Row> ovsRows = ovsdbConfigurationService.getRows(node,
-                ovsdbConfigurationService.getTableName(node, OpenVSwitch.class));
-
-        if (ovsRows == null) {
-            logger.info("The OVS node {} has no Open_vSwitch rows", node.toString());
-            return null;
-        }
-
-        Version ovsVersion = null;
-        // While there is only one entry in the HashMap, we can't access it by index...
-        for (Row row : ovsRows.values()) {
-            OpenVSwitch ovsRow = ovsdbConfigurationService.getTypedRow(node, OpenVSwitch.class, row);
-            Set<String> versionSet = ovsRow.getOvsVersionColumn().getData();
-            if (versionSet != null && versionSet.iterator().hasNext()) {
-                ovsVersion = Version.fromString(versionSet.iterator().next());
-            }
-        }
-
-        if (ovsVersion == null || ovsVersion.compareTo(Constants.OPENFLOW13_SUPPORTED) < 0) {
-            return Constants.OPENFLOW10;
-        }
-
         return Constants.OPENFLOW13;
     }