Merge "BUG-5006: rework SouthboundProviderTest, clean up"
authorSam Hague <shague@redhat.com>
Fri, 19 Feb 2016 17:16:22 +0000 (17:16 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 19 Feb 2016 17:16:22 +0000 (17:16 +0000)
44 files changed:
README
features/src/main/features/features.xml
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepConnectionInstance.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepConnectionManager.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepDataChangeListener.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepSouthboundProvider.java
hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepGlobalRemoveCommand.java
hwvtepsouthbound/hwvtepsouthbound-it/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/it/HwvtepSouthboundIT.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/impl/OvsdbClientImpl.java
library/impl/src/test/java/org/opendaylight/ovsdb/lib/schema/typed/TyperUtilsTest.java
openstack/net-virt-it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/it/NetvirtIT.java
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/AbstractServiceInstance.java
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/OF13Provider.java
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/services/EgressAclService.java
openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/services/IngressAclService.java
openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/NetvirtSfcAclListener.java
openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/NetvirtSfcClassifierListener.java
openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/RspListener.java
openstack/net-virt-sfc/impl/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/workaround/services/SfcClassifierService.java
openstack/net-virt-sfc/it/src/test/java/org/opendaylight/ovsdb/openstack/netvirt/sfc/it/NetvirtSfcIT.java
openstack/net-virt/pom.xml
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/ConfigActivator.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/DistributedArpService.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/NeutronL3Adapter.java
southbound/southbound-impl/pom.xml
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbConnectionInstance.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbConnectionManager.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/SouthboundMapper.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/SouthboundProvider.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/BridgeUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/OvsdbNodeUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/QosUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/QueueUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TerminationPointCreateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/TerminationPointUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbBridgeUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbNodeRemoveCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbPortUpdateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbQueueUpdateCommand.java
southbound/southbound-it/src/test/java/org/opendaylight/ovsdb/southbound/it/SouthboundIT.java
utils/mdsal-openflow/src/main/java/org/opendaylight/ovsdb/utils/mdsal/openflow/FlowUtils.java
utils/mdsal-openflow/src/main/java/org/opendaylight/ovsdb/utils/mdsal/openflow/MatchUtils.java
utils/southbound-utils/src/main/java/org/opendaylight/ovsdb/utils/southbound/utils/SouthboundUtils.java

diff --git a/README b/README
index a3a45ae871640ac0a3ec207b374edf3efdb146dd..9bd5064abda15f6ecc6da6f14ffa2cd39c2146ef 100644 (file)
--- a/README
+++ b/README
@@ -4,13 +4,13 @@ DIRECTORY ORGANIZATION
 - commons
   +-- parent : Contains Parent pom.xml for all the ovsdb modules.
 
-- distribution : Builds a working controller distribution based on the controller + ovsdb modules and other
-                 dependant modules such as openflowplugin
-  +-- opendaylight : older, OSGi-based distribution
-  +-- opendaylight-karaf : karaf-based distribution
-
 - features : This folder contains all the Karaf related files.
 
+- hwvtepsouthbound : Contains the hw_vtep southbound plugin.
+
+- karaf : Builds a working controller distribution based on the controller + ovsdb modules and other
+          dependant modules such as openflowplugin
+
 - library : Contains Schema-independent library that is a reference implementation for RFC 7047.
             This module doesn't depend on any of the Opendaylight components.
             This library module can also be used independently in a non-OSGi environment.
@@ -20,18 +20,9 @@ DIRECTORY ORGANIZATION
                  for Network Virtualization.
   +-- net-virt-providers : Mostly contains data-path programming functionality via OpenFlow or potentially
                            other protocols.
+  +-- net-virt-sfc : SFC implementation using the OVSDB project.
 
-- ovs-sfc : SFC implementation using the OVSDB project. Currently it is just a shell.
-
-- plugin : Contains Opendaylight Southbound Plugin APIs and provides a simpler API interface on top of library layer.
-           Ideally, this module should also be schema independent. But due to legacy reasons this layer contains some
-           deprecated functionality that assumes openvswitch schema.
-
-- plugin-mdsal-adapter : Adds an MD-SAL Adapter for the OVSDB Plugin. The adapter updates the MD-SAL with nodes
-                         as they are added and removed from the inventory. The Yang model provides a reference
-                         between OVSDB nodes and the OpenFlow nodes (bridges) that they manage.
-
-- plugin-shell : Contains a Karaf shell framework for OVSDB plugin and printCache command-line.
+- ovsdb-ui : Contains the DLUX implementation for displaying network virtualization
 
 - resources : Contains some useful resources such as scripts, testing utilities and tools used for deployment
               or testing the binaries generated from the OVSDB project.
@@ -40,6 +31,8 @@ DIRECTORY ORGANIZATION
   +-- openvswitch : Schema wrapper that represents http://openvswitch.org/ovs-vswitchd.conf.db.5.pdf
   +-- hardwarevtep: Schema wrapper that represents http://openvswitch.org/docs/vtep.5.pdf
 
+- southbound : contains the plugin for converting from the OVSDB protocol to mdsal and vice-versa.
+
 - utils : MD-SAL OpenFlow and OVSDB common utilities.
 
 HOW TO BUILD & RUN
@@ -48,30 +41,24 @@ HOW TO BUILD & RUN
 Pre-requisites : JDK 1.7+, Maven 3+
 
 1. Building a Karaf Feature and deploying it in an Opendaylight Karaf distribution :
-   1. This is a new method for Opendaylight distribution wherein there is no defined editions such
-      as Base, Virtualization or SP editions. The end-customer can choose to deploy the required feature
-      based on his/her deployment needs.
-
-   2. From the root ovsdb/ directory, execute "mvn clean install"
+   1. From the root ovsdb/ directory, execute "mvn clean install"
 
-   3. Next unzip the distribution-karaf-<VERSION_NUMBER>-SNAPSHOT.zip file created from step #2 in
-      the directory ovsdb/distribution/opendaylight-karaf/target like so:
-      "unzip distribution-karaf-<VERSION_NUMBER>-SNAPSHOT.zip"
+   2. Unzip the karaf-<VERSION_NUMBER>-SNAPSHOT.zip file created from step 1 in the directory ovsdb/karaf/target/:
+      "unzip karaf-<VERSION_NUMBER>-SNAPSHOT.zip"
 
-   4. Once karaf has started and you see the Opendaylight ascii art in the console, the last step
+   3. Once karaf has started and you see the Opendaylight ascii art in the console, the last step
       is to start the OVSDB plugin framework with the following command in the karaf console:
       "feature:install odl-ovsdb-openstack" (without quotation marks).
 
    Sample output from Karaf console :
 
-   opendaylight-user@root>feature:list | grep -i ovsdb
-   odl-ovsdb-all                    | 1.0.0-SNAPSHOT      |           | ovsdb-1.0.0-SNAPSHOT                  | OpenDaylight :: OVSDB :: all
-   odl-ovsdb-library                | 1.0.0-SNAPSHOT      | x         | ovsdb-1.0.0-SNAPSHOT                  | OVSDB :: Library
-   odl-ovsdb-schema-openvswitch     | 1.0.0-SNAPSHOT      | x         | ovsdb-1.0.0-SNAPSHOT                  | OVSDB :: Schema :: Open_vSwitch
-   odl-ovsdb-schema-hardwarevtep    | 1.0.0-SNAPSHOT      | x         | ovsdb-1.0.0-SNAPSHOT                  | OVSDB :: Schema :: hardware_vtep
-   odl-ovsdb-openstack              | 1.0.0-SNAPSHOT      | x         | ovsdb-1.0.0-SNAPSHOT                  | OpenDaylight :: OVSDB :: OpenStack Network Virtual
-   odl-ovsdb-ovssfc                 | 0.0.1-SNAPSHOT      |           | ovsdb-0.0.1-SNAPSHOT                  | OpenDaylight :: OVSDB :: OVS Service Function Chai
-
+  opendaylight-user@root>feature:list -i | grep ovsdb
+   odl-ovsdb-southbound-api          | 1.2.1-SNAPSHOT   | x         | odl-ovsdb-southbound-1.2.1-SNAPSHOT     | OpenDaylight :: southbound :: api
+   odl-ovsdb-southbound-impl         | 1.2.1-SNAPSHOT   | x         | odl-ovsdb-southbound-1.2.1-SNAPSHOT     | OpenDaylight :: southbound :: impl
+   odl-ovsdb-southbound-impl-rest    | 1.2.1-SNAPSHOT   | x         | odl-ovsdb-southbound-1.2.1-SNAPSHOT     | OpenDaylight :: southbound :: impl :: REST
+   odl-ovsdb-southbound-impl-ui      | 1.2.1-SNAPSHOT   | x         | odl-ovsdb-southbound-1.2.1-SNAPSHOT     | OpenDaylight :: southbound :: impl :: UI
+   odl-ovsdb-library                 | 1.2.1-SNAPSHOT   | x         | odl-ovsdb-library-1.2.1-SNAPSHOT        | OpenDaylight :: library
+   odl-ovsdb-openstack               | 1.2.1-SNAPSHOT   | x         | ovsdb-1.2.1-SNAPSHOT                    | OpenDaylight :: OVSDB :: OpenStack Network Virtual
 
 2. Building a bundle and deploying it in an Opendaylight Karaf distribution :
    This method can be used to update and test new code in a bundle. If the bundle of interest is rebuilt as a
@@ -94,61 +81,6 @@ Pre-requisites : JDK 1.7+, Maven 3+
 
    4. karaf will see the changed bundle and reload it.
 
-
-3. Building an OVSDB based Opendaylight Virtualization edition:
-   1. This is the legacy way to build and distribute Opendaylight archives. This method was
-      followed in Hydrogen. It might still work in Helium but it is best effort for support.
-      The preferred method for Helium and later is to use karaf.
-
-   2. From the root folder(that hosts this README), execute "mvn clean install"
-      That should build a full distribution archive and distribution directory that will contain
-      Opendaylight Controller + OVSDB bundles + Openflow Plugins under
-      distribution/opendaylight/target/distribution.ovsdb-X.X.X-osgipackage
-
-   3. Upon successful completion of a build, the Controller with OVSDB can be executed by :
-      cd distribution/opendaylight/target/distribution.ovsdb-X.X.X-osgipackage/opendaylight/
-      ./run.sh -virt ovsdb
-
-4. Building a Karaf Feature and deploying it in an Opendaylight Karaf distribution :
-*** This method is deprecated.
-   1. This is a new method for Opendaylight distribution wherein there is no defined editions such
-      as Base, Virtualization or SP editions. Rather each of the projects will generate features in
-      form of .kar files. The end-customer can choose to deploy the required feature based on his/her
-      deployment needs.
-
-   2. From the features/ directory, execute "mvn clean install"
-      This will generate a kar file such as "features/target/ovsdb-features-1.2.1-SNAPSHOT.kar"
-
-   3. Download (or build from controller project) the Karaf distribution :
-      http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/controller/distribution.opendaylight-karaf/
-      Sample zip file :
-      http://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/controller/distribution.opendaylight-karaf/1.4.2-SNAPSHOT/distribution.opendaylight-karaf-1.4.2-20140718.075612-407.zip
-
-   4. unzip the downloaded (or built) distribution and copy the ovsdb-features-x.x.x.kar file (from step 2) into
-      the unzipped distribution.opendaylight-karaf-X.X.X/deploy/ directory.
-
-   5. run Karaf from within the distribution.opendaylight-karaf-X.X.X/ directory using "bin/karaf"
-
-   Sample output from Karaf console :
-
-   opendaylight-user@root>kar:list
-   KAR Name
-   -----------------------------
-   ovsdb-features-1.2.1-SNAPSHOT
-
-   opendaylight-user@root>feature:list | grep ovsdb
-   odl-ovsdb-all | 1.2.1-SNAPSHOT | x | ovsdb-1.2.1-SNAPSHOT | OpenDaylight :: OVSDB :: all
-   odl-ovsdb-library | 1.0.0-SNAPSHOT | x | ovsdb-1.2.1-SNAPSHOT | OVSDB :: Library
-   odl-ovsdb-schema-openvswitch | 1.0.0-SNAPSHOT | x | ovsdb-1.2.1-SNAPSHOT | OVSDB :: Schema :: Open_vSwitch
-   odl-ovsdb-schema-hardwarevtep | 1.0.0-SNAPSHOT | x | ovsdb-1.2.1-SNAPSHOT | OVSDB :: Schema :: hardware_vtep
-   odl-ovsdb-plugin | 1.0.0-SNAPSHOT | x | ovsdb-1.2.1-SNAPSHOT | OpenDaylight :: OVSDB :: Plugin
-
-   opendaylight-user@root>bundle:list | grep OVSDB
-   186 | Active | 80 | 1.0.0.SNAPSHOT | OVSDB Library
-   199 | Active | 80 | 1.0.0.SNAPSHOT | OVSDB Open_vSwitch Schema
-   200 | Active | 80 | 1.0.0.SNAPSHOT | OVSDB hardware_vtep Schema
-   201 | Active | 80 | 1.0.0.SNAPSHOT | OpenDaylight OVSDB Plugin
-
 Running The Integration Tests
 =============================
 
index ea488c2c51e51635e98903f9fc9e5c4207cba80c..1e5fc8c5fb8a0b2793c442629a427d573884d7ba 100644 (file)
   <repository>mvn:org.opendaylight.netconf/features-restconf/{{VERSION}}/xml/features</repository>
   <repository>mvn:org.opendaylight.ovsdb/hwvtepsouthbound-features/{{VERSION}}/xml/features</repository>
 
-  <feature name="odl-ovsdb-all" description="OpenDaylight :: OVSDB :: all"
-           version='${project.version}'>
-    <feature version="${project.version}">odl-ovsdb-library</feature>
-  </feature>
-
   <feature name="odl-ovsdb-schema-openvswitch" description="OVSDB :: Schema :: Open_vSwitch"
            version='${project.version}'>
     <feature version="${project.version}">odl-ovsdb-library</feature>
index 04ec20fa8bedbb5667bacc8a4844c8dae366fd56..77aeb7cf6fcdd1371f28e47feb817ba728651ebe 100644 (file)
@@ -112,7 +112,7 @@ public class HwvtepConnectionInstance implements OvsdbClient{
                     transactInvokers.put(dbSchema, new TransactInvokerImpl(this,dbSchema));
                 }
             } catch (InterruptedException | ExecutionException e) {
-                LOG.warn("Exception attempting to createTransactionInvokers {}: {}",connectionInfo,e);
+                LOG.warn("Exception attempting to createTransactionInvokers {}", connectionInfo, e);
             }
         }
     }
index 85a83662da53b60f8c6b474945f2474a588d7f53..1869f49df48afac12111bf984363399c6bfe54b3 100644 (file)
@@ -96,8 +96,10 @@ public class HwvtepConnectionManager implements OvsdbConnectionListener, AutoClo
                 client.getConnectionInfo().getRemotePort(),
                 client.getConnectionInfo().getLocalAddress(),
                 client.getConnectionInfo().getLocalPort());
-        HwvtepConnectionInstance hwClient = connectedButCallBacksNotRegistered(client);
-        registerEntityForOwnership(hwClient);
+        if(client.getSchema(HwvtepSchemaConstants.HARDWARE_VTEP) != null) {
+            HwvtepConnectionInstance hwClient = connectedButCallBacksNotRegistered(client);
+            registerEntityForOwnership(hwClient);
+        }
     }
 
     @Override
@@ -274,7 +276,7 @@ public class HwvtepConnectionManager implements OvsdbConnectionListener, AutoClo
                 }
             }
         } catch (CandidateAlreadyRegisteredException e) {
-            LOG.warn("OVSDB entity {} was already registered for {} ownership", candidateEntity, e);
+            LOG.warn("OVSDB entity {} was already registered for ownership", candidateEntity, e);
         }
 
     }
index 6eab4fa5e8c72008892ad0d964643fc0d81bcae7..08106386991967598a203afb5cf8a28b067e2434 100644 (file)
@@ -61,7 +61,7 @@ public class HwvtepDataChangeListener implements ClusteredDataTreeChangeListener
             LOG.trace("Registering on path: {}", treeId);
             registration = db.registerDataTreeChangeListener(treeId, HwvtepDataChangeListener.this);
         } catch (final Exception e) {
-            LOG.warn("HwvtepDataChangeListener registration failed");
+            LOG.warn("HwvtepDataChangeListener registration failed", e);
             //TODO: Should we throw an exception here?
         }
     }
index 44a278911b7ee950527ee95559c8ad8ca47641ab..f960d3631eb38c8e21915895584885fcebfbd0c6 100644 (file)
@@ -91,7 +91,7 @@ public class HwvtepSouthboundProvider implements BindingAwareProvider, AutoClose
             }
         } catch (CandidateAlreadyRegisteredException e) {
             LOG.warn("HWVTEP Southbound Provider instance entity {} was already "
-                    + "registered for {} ownership", instanceEntity, e);
+                    + "registered for ownership", instanceEntity, e);
         }
     }
 
@@ -150,7 +150,7 @@ public class HwvtepSouthboundProvider implements BindingAwareProvider, AutoClose
                 transaction.cancel();
             }
         } catch (Exception e) {
-            LOG.error("Error initializing hwvtep topology {}",e);
+            LOG.error("Error initializing hwvtep topology", e);
         }
     }
 
index 848cb5a6171e54cb96d56f018908138e48e7f618..8ee8917469dd3a353bff2ab0158574af38388884 100644 (file)
@@ -64,7 +64,7 @@ public class HwvtepGlobalRemoveCommand extends AbstractTransactionCommand {
                 }
             }
         } catch (Exception e) {
-            LOG.warn("Failure to delete ovsdbNode {}", e);
+            LOG.warn("Failure to delete ovsdbNode", e);
         }
     }
 
index cfeb8e0bd0014a2167307c6685a9c6df3ccd9c64..8136e593ef689c6fe42213cb39303e28aec89781 100644 (file)
@@ -257,7 +257,8 @@ public class HwvtepSouthboundIT extends AbstractMdsalTestBase {
         try {
             super.setup();
         } catch (Exception e) {
-            e.printStackTrace();
+            LOG.warn("Failed to setup test", e);
+            fail("Failed to setup test: " + e);
         }
         //dataBroker = getSession().getSALService(DataBroker.class);
         Thread.sleep(3000);
@@ -269,7 +270,7 @@ public class HwvtepSouthboundIT extends AbstractMdsalTestBase {
         try {
             portNumber = Integer.parseInt(portStr);
         } catch (NumberFormatException e) {
-            fail("Invalid port number " + portStr + System.lineSeparator() + usage());
+            fail("Invalid port number " + portStr + System.lineSeparator() + usage() + e);
         }
 
         connectionType = bundleContext.getProperty(CONNECTION_TYPE);
index 0ea4e09365de3894c71d860b6b152f6e3ded24aa..72232df19efc482dd8f59902cff43a9fed045b88 100644 (file)
@@ -168,6 +168,7 @@ public class OvsdbClientImpl implements OvsdbClient {
         try {
             result = monitor.get();
         } catch (InterruptedException | ExecutionException e) {
+            LOG.warn("Failed to monitor {}", dbSchema, e);
             return null;
         }
         return transformingCallback(result, dbSchema);
@@ -199,6 +200,7 @@ public class OvsdbClientImpl implements OvsdbClient {
         try {
             result = monitor.get();
         } catch (InterruptedException | ExecutionException e) {
+            LOG.warn("Failed to monitor {}", dbSchema, e);
             return null;
         }
         return transformingCallback(result, dbSchema);
@@ -222,7 +224,7 @@ public class OvsdbClientImpl implements OvsdbClient {
         try {
             result = cancelMonitor.get();
         } catch (InterruptedException | ExecutionException e) {
-            LOG.error("Exception when canceling monitor handler {}", handler.getId());
+            LOG.error("Exception when canceling monitor handler {}", handler.getId(), e);
         }
 
         if (result == null) {
@@ -332,6 +334,7 @@ public class OvsdbClientImpl implements OvsdbClient {
                                 sfuture.set(schema);
                             }
                         } catch (Exception e) {
+                            LOG.warn("Failed to populate schema {}:{}", dbNames, schema, e);
                             sfuture.setException(e);
                         }
                         return null;
index cf851eb6616a7473044cda3afa92186684a0a2ba..c70c36064549c4786d2baa3044b56a4885cb0fde 100644 (file)
@@ -103,7 +103,7 @@ public class TyperUtilsTest {
             method.setAccessible(true);
             method.invoke(TyperUtils.class, schema, from, to);
         } catch (NoSuchMethodException e) {
-            LOG.error("Can't find TyperUtils::checkVersion(), TyperUtilsTest::callCheckVersion() may be obsolete");
+            LOG.error("Can't find TyperUtils::checkVersion(), TyperUtilsTest::callCheckVersion() may be obsolete", e);
         } catch (IllegalAccessException e) {
             LOG.error("Error invoking TyperUtils::checkVersion(), please check TyperUtilsTest::callCheckVersion()", e);
         } catch (InvocationTargetException e) {
index db101d6164f09a90a0921ed130c1ddec17636a0a..d8ef43b9309730951bffccb4f1a5e3243940e037 100644 (file)
@@ -227,7 +227,8 @@ public class NetvirtIT extends AbstractMdsalTestBase {
         try {
             super.setup();
         } catch (Exception e) {
-            e.printStackTrace();
+            LOG.warn("Failed to setup test", e);
+            fail("Failed to setup test: " + e);
         }
 
         getProperties();
@@ -261,7 +262,7 @@ public class NetvirtIT extends AbstractMdsalTestBase {
                 try {
                     Thread.sleep(1000);
                 } catch (InterruptedException e) {
-                    e.printStackTrace();
+                    LOG.warn("Interrupted while waiting for provider context", e);
                 }
             }
         }
@@ -270,7 +271,7 @@ public class NetvirtIT extends AbstractMdsalTestBase {
         try {
             Thread.sleep(1000);
         } catch (InterruptedException e) {
-            e.printStackTrace();
+            LOG.warn("Interrupted while waiting for other provider", e);
         }
         return providerContext;
     }
@@ -298,7 +299,7 @@ public class NetvirtIT extends AbstractMdsalTestBase {
                 try {
                     Thread.sleep(1000);
                 } catch (InterruptedException e) {
-                    e.printStackTrace();
+                    LOG.warn("Interrupted while waiting for {}", NETVIRT_TOPOLOGY_ID, e);
                 }
             }
         }
index 2153a689a833dee0a2fa5144432b84e63a0d45f2..d11486a2836bf63f36917d59f035ca085c381530 100644 (file)
@@ -166,7 +166,7 @@ public abstract class AbstractServiceInstance {
                 commitFuture.checkedGet();  // TODO: Make it async (See bug 1362)
                 LOG.debug("Transaction success for write of Flow {}", flowBuilder.getFlowName());
             } catch (Exception e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Failed to write flow {}", flowBuilder.getFlowName(), e);
                 modification.cancel();
             }
         }
@@ -182,7 +182,7 @@ public abstract class AbstractServiceInstance {
                 commitFuture.get();  // TODO: Make it async (See bug 1362)
                 LOG.debug("Transaction success for deletion of Flow {}", flowBuilder.getFlowName());
             } catch (Exception e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Failed to remove flow {}", flowBuilder.getFlowName(), e);
                 modification.cancel();
             }
         }
@@ -197,7 +197,7 @@ public abstract class AbstractServiceInstance {
                 return data.get();
             }
         } catch (InterruptedException|ExecutionException e) {
-            LOG.error(e.getMessage(), e);
+            LOG.error("Failed to get flow {}", flowBuilder.getFlowName(), e);
         }
 
         LOG.debug("Cannot find data for Flow {}", flowBuilder.getFlowName());
@@ -215,7 +215,7 @@ public abstract class AbstractServiceInstance {
                 return data.get();
             }
         } catch (InterruptedException|ExecutionException e) {
-            LOG.error(e.getMessage(), e);
+            LOG.error("Failed to get openflow node {}", nodeId, e);
         }
 
         LOG.debug("Cannot find data for Node {}", nodeId);
index 55271c54eac3f010177d4bc924dd54597d00031f..84665e4c84d78d792ad50bb31716f2e916f1be5c 100644 (file)
@@ -772,7 +772,7 @@ public class OF13Provider implements ConfigInterface, NetworkingProvider {
                 programLocalBridgeRules(node, dpid, segmentationId, attachedMac, localPort);
             }
         } catch (Exception e) {
-            LOG.error("Exception in programming Local Rules for " + intf + " on " + node, e);
+            LOG.error("Exception in programming Local Rules for {} on {}", intf, node, e);
         }
     }
 
@@ -811,7 +811,7 @@ public class OF13Provider implements ConfigInterface, NetworkingProvider {
                 programLocalSecurityGroupRules(attachedMac, node, intf, dpid, localPort, segmentationId, false);
             }
         } catch (Exception e) {
-            LOG.error("Exception in removing Local Rules for " + intf + " on " + node, e);
+            LOG.error("Exception in removing Local Rules for {} on {}", intf, node, e);
         }
     }
 
@@ -867,7 +867,7 @@ public class OF13Provider implements ConfigInterface, NetworkingProvider {
                 }
             }
         } catch (Exception e) {
-            LOG.trace("", e);
+            LOG.warn("Failed to program tunnel rules, node {}, intf {}", node, intf, e);
         }
     }
 
@@ -919,7 +919,7 @@ public class OF13Provider implements ConfigInterface, NetworkingProvider {
                 }
             }
         } catch (Exception e) {
-            LOG.error("", e);
+            LOG.error("Failed to remove tunnel rules, node {}, intf {}", node, intf, e);
         }
     }
 
@@ -1191,7 +1191,7 @@ public class OF13Provider implements ConfigInterface, NetworkingProvider {
                         MdsalHelper.createOvsdbInterfaceType(intf.getInterfaceType()),
                         src, dst);
             } catch (Exception e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("handleInterfaceDelete: failed to delete tunnel port", e);
             }
         } else if (phyIfName.contains(intf.getName())) {
             deletePhysicalPort(srcNode, intf.getName());
@@ -1556,10 +1556,10 @@ public class OF13Provider implements ConfigInterface, NetworkingProvider {
                 return data.get();
             }
         } catch (InterruptedException|ExecutionException e) {
-            LOG.error(e.getMessage(), e);
+            LOG.error("Failed to get group {}", groupBuilder.getGroupName(), e);
         }
 
-        LOG.debug("Cannot find data for Group " + groupBuilder.getGroupName());
+        LOG.debug("Cannot find data for Group {}", groupBuilder.getGroupName());
         return null;
     }
 
@@ -1574,9 +1574,9 @@ public class OF13Provider implements ConfigInterface, NetworkingProvider {
             CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
             try {
                 commitFuture.get();  // TODO: Make it async (See bug 1362)
-                LOG.debug("Transaction success for write of Group " + groupBuilder.getGroupName());
+                LOG.debug("Transaction success for write of Group {}", groupBuilder.getGroupName());
             } catch (InterruptedException|ExecutionException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Failed to write group {}", groupBuilder.getGroupName(), e);
             }
         }
     }
@@ -1592,9 +1592,9 @@ public class OF13Provider implements ConfigInterface, NetworkingProvider {
 
             try {
                 commitFuture.get();  // TODO: Make it async (See bug 1362)
-                LOG.debug("Transaction success for deletion of Group " + groupBuilder.getGroupName());
+                LOG.debug("Transaction success for deletion of Group {}", groupBuilder.getGroupName());
             } catch (InterruptedException|ExecutionException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Failed to remove group {}", groupBuilder.getGroupName(), e);
             }
         }
     }
@@ -1616,9 +1616,9 @@ public class OF13Provider implements ConfigInterface, NetworkingProvider {
             CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
             try {
                 commitFuture.get();  // TODO: Make it async (See bug 1362)
-                LOG.debug("Transaction success for write of Flow " + flowBuilder.getFlowName());
+                LOG.debug("Transaction success for write of Flow {}", flowBuilder.getFlowName());
             } catch (InterruptedException|ExecutionException e) {
-                LOG.error(e.getMessage(), e);
+                LOG.error("Failed to write flows {}", flowBuilder.getFlowName(), e);
             }
         }
     }
index db03e23035de9a25dfaebe50b31fdb0db806d95d..68ae031e9f7808e999a7d22f67f3471af6ae4568 100644 (file)
@@ -165,7 +165,7 @@ public class EgressAclService extends AbstractServiceInstance implements EgressA
                         return;
                     }
                 } catch (UnknownHostException e) {
-                    LOG.warn("Invalid IP address {}", ipaddress);
+                    LOG.warn("Invalid IP address {}", ipaddress, e);
                     return;
                 }
             }
@@ -266,7 +266,7 @@ public class EgressAclService extends AbstractServiceInstance implements EgressA
                                                                Constants.PROTO_VM_IP_MAC_MATCH_PRIORITY,write);
                     }
                 } catch(UnknownHostException e) {
-                    LOG.warn("Invalid IP address {}", srcAddress.getIpAddress());
+                    LOG.warn("Invalid IP address {}", srcAddress.getIpAddress(), e);
                 }
             }
         }
@@ -315,7 +315,8 @@ public class EgressAclService extends AbstractServiceInstance implements EgressA
          NodeBuilder nodeBuilder = createNodeBuilder(nodeName);
          String flowName = "Egress_Fixed_Conntrk_Untrk_" + segmentationId + "_" + localPort + "_";
          matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder, attachMac, null);
-         matchBuilder = MatchUtils.addCtState(matchBuilder,0x00,0X80);
+         matchBuilder = MatchUtils.addCtState(matchBuilder,MatchUtils.UNTRACKED_CT_STATE,
+                                              MatchUtils.UNTRACKED_CT_STATE_MASK);
          FlowBuilder flowBuilder = new FlowBuilder();
          flowBuilder.setMatch(matchBuilder.build());
          FlowUtils.initFlowBuilder(flowBuilder, flowName, getTable()).setPriority(priority);
@@ -351,7 +352,8 @@ public class EgressAclService extends AbstractServiceInstance implements EgressA
          NodeBuilder nodeBuilder = createNodeBuilder(nodeName);
          String flowName = "Egress_Fixed_Conntrk_TrkEst_" + segmentationId + "_" + localPort + "_";
          matchBuilder = MatchUtils.createInPortMatch(matchBuilder, dpid, localPort);
-         matchBuilder = MatchUtils.addCtState(matchBuilder,0x82, 0x82);
+         matchBuilder = MatchUtils.addCtState(matchBuilder,MatchUtils.TRACKED_EST_CT_STATE,
+                                              MatchUtils.TRACKED_EST_CT_STATE_MASK);
          FlowBuilder flowBuilder = new FlowBuilder();
          flowBuilder.setMatch(matchBuilder.build());
          FlowUtils.initFlowBuilder(flowBuilder, flowName, getTable()).setPriority(priority);
@@ -379,7 +381,7 @@ public class EgressAclService extends AbstractServiceInstance implements EgressA
          NodeBuilder nodeBuilder = createNodeBuilder(nodeName);
          String flowName = "Egress_Fixed_Conntrk_NewDrop_" + segmentationId + "_" + localPort + "_";
          matchBuilder = MatchUtils.createInPortMatch(matchBuilder, dpid, localPort);
-         matchBuilder = MatchUtils.addCtState(matchBuilder,0x01, 0x01);
+         matchBuilder = MatchUtils.addCtState(matchBuilder,MatchUtils.NEW_CT_STATE, MatchUtils.NEW_CT_STATE_MASK);
          FlowBuilder flowBuilder = new FlowBuilder();
          flowBuilder.setMatch(matchBuilder.build());
          FlowUtils.initFlowBuilder(flowBuilder, flowName, getTable()).setPriority(priority);
@@ -817,7 +819,8 @@ public class EgressAclService extends AbstractServiceInstance implements EgressA
                           boolean write, boolean drop, boolean isCtCommit) {
         MatchBuilder matchBuilder1 = matchBuilder;
         if (isCtCommit) {
-            matchBuilder1 = MatchUtils.addCtState(matchBuilder1,0x81, 0x81);
+            matchBuilder1 = MatchUtils.addCtState(matchBuilder1, MatchUtils.TRACKED_NEW_CT_STATE,
+                                                  MatchUtils.TRACKED_NEW_CT_STATE_MASK);
         }
         FlowBuilder flowBuilder = new FlowBuilder();
         flowBuilder.setMatch(matchBuilder1.build());
index 651d8ffd93fca5294689f07549d728e6699c8847..f7c393a38e726ddcffdc1477392c8ef2d0c21680 100644 (file)
@@ -163,7 +163,7 @@ public class IngressAclService extends AbstractServiceInstance implements Ingres
                         return;
                     }
                 } catch(UnknownHostException e) {
-                    LOG.warn("Invalid IP address {}", ipaddress);
+                    LOG.warn("Invalid IP address {}", ipaddress, e);
                     return;
                 }
             }
@@ -285,7 +285,8 @@ public class IngressAclService extends AbstractServiceInstance implements Ingres
         NodeBuilder nodeBuilder = createNodeBuilder(nodeName);
         String flowName = "Ingress_Fixed_Conntrk_Untrk_" + segmentationId + "_" + localPort + "_";
         matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,null,attachMac);
-        matchBuilder = MatchUtils.addCtState(matchBuilder,0x00, 0x80);
+        matchBuilder = MatchUtils.addCtState(matchBuilder,MatchUtils.UNTRACKED_CT_STATE,
+                                             MatchUtils.UNTRACKED_CT_STATE_MASK);
         FlowBuilder flowBuilder = new FlowBuilder();
         flowBuilder.setMatch(matchBuilder.build());
         FlowUtils.initFlowBuilder(flowBuilder, flowName, getTable()).setPriority(priority);
@@ -323,7 +324,8 @@ public class IngressAclService extends AbstractServiceInstance implements Ingres
         NodeBuilder nodeBuilder = createNodeBuilder(nodeName);
         String flowName = "Ingress_Fixed_Conntrk_TrkEst_" + segmentationId + "_" + localPort + "_";
         matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,null,attachMac);
-        matchBuilder = MatchUtils.addCtState(matchBuilder,0x82, 0x82);
+        matchBuilder = MatchUtils.addCtState(matchBuilder,MatchUtils.TRACKED_EST_CT_STATE,
+                                             MatchUtils.TRACKED_EST_CT_STATE_MASK);
         FlowBuilder flowBuilder = new FlowBuilder();
         flowBuilder.setMatch(matchBuilder.build());
         FlowUtils.initFlowBuilder(flowBuilder, flowName, getTable()).setPriority(priority);
@@ -351,7 +353,7 @@ public class IngressAclService extends AbstractServiceInstance implements Ingres
         NodeBuilder nodeBuilder = createNodeBuilder(nodeName);
         String flowName = "Ingress_Fixed_Conntrk_NewDrop_" + segmentationId + "_" + localPort + "_";
         matchBuilder = MatchUtils.createV4EtherMatchWithType(matchBuilder,null,attachMac);
-        matchBuilder = MatchUtils.addCtState(matchBuilder,0x01, 0x01);
+        matchBuilder = MatchUtils.addCtState(matchBuilder,MatchUtils.NEW_CT_STATE, MatchUtils.NEW_CT_STATE_MASK);
         FlowBuilder flowBuilder = new FlowBuilder();
         flowBuilder.setMatch(matchBuilder.build());
         FlowUtils.initFlowBuilder(flowBuilder, flowName, getTable()).setPriority(priority);
@@ -725,7 +727,8 @@ public class IngressAclService extends AbstractServiceInstance implements Ingres
                           boolean write, boolean drop, boolean isCtCommit) {
         MatchBuilder matchBuilder1 = matchBuilder;
         if (isCtCommit) {
-            matchBuilder1 = MatchUtils.addCtState(matchBuilder1,0x81, 0x81);
+            matchBuilder1 = MatchUtils.addCtState(matchBuilder1,MatchUtils.TRACKED_NEW_CT_STATE,
+                                                  MatchUtils.TRACKED_NEW_CT_STATE_MASK);
         }
         FlowBuilder flowBuilder = new FlowBuilder();
         flowBuilder.setMatch(matchBuilder1.build());
index f8cc5703697cd59eca05ccf69c428f903302c554..5fea53f33f8250557f16fcbc653a64faae4eea7e 100644 (file)
@@ -46,7 +46,7 @@ public class NetvirtSfcAclListener extends AbstractDataTreeListener<Acl> {
             LOG.info("Registering Data Change Listener for NetvirtSfc AccessList configuration.");
             listenerRegistration = db.registerDataTreeChangeListener(treeId, this);
         } catch (final Exception e) {
-            LOG.warn("Netvirt AccessList DataChange listener registration fail!");
+            LOG.warn("Netvirt AccessList DataChange listener registration fail!", e);
             throw new IllegalStateException("NetvirtSfcAccessListListener startup fail! System needs restart.", e);
         }
     }
index 066c5a7d73d677163d51c9265ef8d4ce6ca5dc25..1ddfb948e8e75c8f8426cad86043f0207c1a7041 100644 (file)
@@ -53,7 +53,7 @@ public class NetvirtSfcClassifierListener extends AbstractDataTreeListener<Class
             LOG.info("Registering Data Change Listener for NetvirtSfc Classifier configuration.");
             listenerRegistration = db.registerDataTreeChangeListener(treeId, this);
         } catch (final Exception e) {
-            LOG.warn("Netvirt Classifier DataChange listener registration fail!");
+            LOG.warn("Netvirt Classifier DataChange listener registration fail!", e);
             throw new IllegalStateException("NetvirtSfcClassifierListener startup fail! System needs restart.", e);
         }
     }
@@ -64,7 +64,7 @@ public class NetvirtSfcClassifierListener extends AbstractDataTreeListener<Class
             try {
                 listenerRegistration.close();
             } catch (final Exception e) {
-                LOG.warn("Error to stop Netvirt Classifier DataChange listener: {}", e.getMessage());
+                LOG.warn("Error to stop Netvirt Classifier DataChange listener", e);
             }
             listenerRegistration = null;
         }
index 56787c9a84b65c54addc901a9ab100be1649777c..996c1662bf640faa153dd0942789f71c63890d96 100644 (file)
@@ -43,7 +43,7 @@ public class RspListener extends AbstractDataTreeListener<RenderedServicePath> {
             LOG.info("Registering Data Change Listener for NetvirtSfc RenderedServicePath configuration.");
             listenerRegistration = db.registerDataTreeChangeListener(treeId, this);
         } catch (final Exception e) {
-            LOG.warn("Netvirt RenderedServicePath DataChange listener registration failed!");
+            LOG.warn("Netvirt RenderedServicePath DataChange listener registration failed!", e);
             throw new IllegalStateException("RspListener startup failed! System needs restart.", e);
         }
     }
index 3cee6f055dc0eb64ba179101590e371b23a20fcb..c7f5d32e957b0f8550b3cab2faae81d4331cc8f0 100644 (file)
@@ -534,7 +534,7 @@ public class SfcClassifierService extends AbstractServiceInstance implements Con
             commitFuture.get();  // TODO: Make it async (See bug 1362)
             LOG.debug("Transaction success for deletion of Flow {}", path);
         } catch (Exception e) {
-            LOG.error(e.getMessage(), e);
+            LOG.error("Failed to remove flow {}", path, e);
             modification.cancel();
         }
     }
index c98d8e089d131287f0dd578c1a75451fb8e0db8e..cdc79119bb456dba39dc0535127a482b08390d19 100644 (file)
@@ -342,7 +342,8 @@ public class NetvirtSfcIT extends AbstractMdsalTestBase {
             Thread.sleep(1000);
             super.setup();
         } catch (Exception e) {
-            e.printStackTrace();
+            LOG.warn("Failed to setup test", e);
+            fail("Failed to setup test: " + e);
         }
 
         getProperties();
@@ -377,7 +378,7 @@ public class NetvirtSfcIT extends AbstractMdsalTestBase {
                 try {
                     Thread.sleep(1000);
                 } catch (InterruptedException e) {
-                    e.printStackTrace();
+                    LOG.warn("Interrupted while waiting for provider context", e);
                 }
             }
         }
@@ -386,7 +387,7 @@ public class NetvirtSfcIT extends AbstractMdsalTestBase {
         try {
             Thread.sleep(1000);
         } catch (InterruptedException e) {
-            e.printStackTrace();
+            LOG.warn("Interrupted while waiting for other provider", e);
         }
         return providerContext;
     }
@@ -414,7 +415,7 @@ public class NetvirtSfcIT extends AbstractMdsalTestBase {
                 try {
                     Thread.sleep(1000);
                 } catch (InterruptedException e) {
-                    e.printStackTrace();
+                    LOG.warn("Interrupted while waiting for {}", NETVIRT_TOPOLOGY_ID, e);
                 }
             }
         }
@@ -979,7 +980,7 @@ public class NetvirtSfcIT extends AbstractMdsalTestBase {
             try {
                 listener.close();
             } catch (Exception ex) {
-                LOG.warn("Failed to close registration {}, iid {}", listener, ex);
+                LOG.warn("Failed to close registration {}", listener, ex);
             }
         }
         LOG.info("waitList size {}", waitList.size());
index 73fa3c68541b71d2dee342d3c146bae1c67e9ad6..a15efac65fe51476966ca3c8264f2955afdccb63 100644 (file)
@@ -165,7 +165,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal-binding-broker-impl</artifactId>
-      <version>1.3.0-SNAPSHOT</version>
       <type>test-jar</type>
       <scope>test</scope>
     </dependency>
index eb71acc94b160fdd141fda8203bb459bbe68262e..44fa6d07df0da9a1246d832b2625a4f551e69ac7 100644 (file)
@@ -196,21 +196,18 @@ public class ConfigActivator implements BundleActivator {
         registerService(context,
                 new String[]{EventDispatcher.class.getName()}, null, eventDispatcher);
 
-        Dictionary<String, Object> neutronL3AdapterProperties = new Hashtable<>();
-        neutronL3AdapterProperties.put(Constants.EVENT_HANDLER_TYPE_PROPERTY,
-                AbstractEvent.HandlerType.NEUTRON_L3_ADAPTER);
         final NeutronL3Adapter neutronL3Adapter = new NeutronL3Adapter(
                 new NeutronModelsDataStoreHelper(this.providerContext.getSALService(DataBroker.class)));
-        registerService(context,
-                new String[]{NeutronL3Adapter.class.getName(), GatewayMacResolverListener.class.getName()},
-                neutronL3AdapterProperties, neutronL3Adapter);
+        registerAbstractHandlerService(context, new Class[] {NeutronL3Adapter.class, GatewayMacResolverListener.class},
+                AbstractEvent.HandlerType.NEUTRON_L3_ADAPTER, neutronL3Adapter);
 
+        // TODO Why is DistributedArpService registered as an event handler without being an AbstractHandlerService?
         Dictionary<String, Object> distributedArpServiceProperties = new Hashtable<>();
         distributedArpServiceProperties.put(Constants.EVENT_HANDLER_TYPE_PROPERTY,
                 AbstractEvent.HandlerType.DISTRIBUTED_ARP_SERVICE);
         final DistributedArpService distributedArpService = new DistributedArpService();
         registerService(context,
-                new String[]{DistributedArpService.class.getName()},
+                new String[] {DistributedArpService.class.getName()},
                 distributedArpServiceProperties, distributedArpService);
 
         OpenstackRouter openstackRouter = new OpenstackRouter();
index 70b06201fb014e15251a1e7a24b67bab857273e1..3f19bafd77c6efc3aaab6f08c4ec6a5a99b0cedd 100644 (file)
@@ -175,7 +175,7 @@ public class BridgeConfigurationManagerImpl implements BridgeConfigurationManage
         Node ovsdbNode = southbound.readOvsdbNode(bridgeNode);
         if (ovsdbNode == null) {
             //this should never happen
-            LOG.error("createLocalNetwork could not find ovsdbNode from bridge node " + bridgeNode);
+            LOG.error("createLocalNetwork could not find ovsdbNode from bridge node {}", bridgeNode);
             return false;
         }
         if (network.getProviderNetworkType().equalsIgnoreCase(NetworkHandler.NETWORK_TYPE_VLAN)) {
@@ -183,7 +183,7 @@ public class BridgeConfigurationManagerImpl implements BridgeConfigurationManage
                 try {
                     isCreated = createBridges(bridgeNode, ovsdbNode, network);
                 } catch (Exception e) {
-                    LOG.error("Error creating internal vlan net network " + bridgeNode, e);
+                    LOG.error("Error creating internal vlan net network {}--{}", bridgeNode, network, e);
                 }
             } else {
                 isCreated = true;
@@ -194,7 +194,7 @@ public class BridgeConfigurationManagerImpl implements BridgeConfigurationManage
                 try {
                     isCreated = createBridges(bridgeNode, ovsdbNode, network);
                 } catch (Exception e) {
-                    LOG.error("Error creating internal vxlan/gre net network " + bridgeNode, e);
+                    LOG.error("Error creating internal vxlan/gre net network {}--{}", bridgeNode, network, e);
                 }
             } else {
                 isCreated = true;
@@ -503,7 +503,7 @@ public class BridgeConfigurationManagerImpl implements BridgeConfigurationManage
                     return addressString;
                 }
             } catch (UnknownHostException e) {
-                LOG.error("Host {} is invalid", addressString);
+                LOG.error("Host {} is invalid", addressString, e);
             }
         }
 
@@ -514,7 +514,7 @@ public class BridgeConfigurationManagerImpl implements BridgeConfigurationManage
                     return addressString;
                 }
             } catch (UnknownHostException e) {
-                LOG.error("Host {} is invalid", addressString);
+                LOG.error("Host {} is invalid", addressString, e);
             }
         }
 
@@ -529,7 +529,7 @@ public class BridgeConfigurationManagerImpl implements BridgeConfigurationManage
                 openFlowPort = Short.parseShort(portString);
             } catch (NumberFormatException e) {
                 LOG.warn("Invalid port:{}, use default({})", portString,
-                        openFlowPort);
+                        openFlowPort, e);
             }
         }
         return openFlowPort;
index 301e3ef22afab5cfcad333c8c1092e3f84903c56..aedf9800c9d4529cc3ae16ddd14156b00931744e 100644 (file)
@@ -121,11 +121,11 @@ public class DistributedArpService implements ConfigInterface {
         }
 
         if (status.isSuccess()) {
-            LOG.debug("ProgramStaticArp {} for mac:{} addr:{} dpid:{} segOrOfPort:{} action:{}",
+            LOG.debug("programStaticRuleStage2 {} for mac:{} addr:{} dpid:{} segOrOfPort:{} action:{}",
                          arpProvider == null ? "skipped" : "programmed",
                          macAddress, address, dpid, segOrOfPort, action);
         } else {
-            LOG.error("ProgramStaticArp failed for mac:{} addr:{} dpid:{} segOrOfPort:{} action:{} status:{}",
+            LOG.error("programStaticRuleStage2 failed for mac:{} addr:{} dpid:{} segOrOfPort:{} action:{} status:{}",
                          macAddress, address, dpid, segOrOfPort, action, status);
         }
         return status;
index 44261aea3bd6b9afe0cb6032f4a4062546790b34..022c05c239140415e252279fd5d20864a8bcf2d2 100644 (file)
@@ -62,6 +62,7 @@ import org.osgi.framework.ServiceReference;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.net.Inet4Address;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.util.ArrayList;
@@ -1214,12 +1215,12 @@ public class NeutronL3Adapter extends AbstractHandler implements GatewayMacResol
         }
 
         if (status.isSuccess()) {
-            LOG.debug("ProgramRouterInterface {} for mac:{} addr:{}/{} node:{} srcTunId:{} destTunId:{} action:{}",
+            LOG.debug("programRouterInterfaceStage2 {} for mac:{} addr:{}/{} node:{} srcTunId:{} destTunId:{} action:{}",
                          routingProvider == null ? "skipped" : "programmed",
                          macAddress, address, mask, node.getNodeId().getValue(), sourceSegmentationId, destinationSegmentationId,
                          actionForNode);
         } else {
-            LOG.error("ProgramRouterInterface failed for mac:{} addr:{}/{} node:{} srcTunId:{} destTunId:{} action:{} status:{}",
+            LOG.error("programRouterInterfaceStage2 failed for mac:{} addr:{}/{} node:{} srcTunId:{} destTunId:{} action:{} status:{}",
                          macAddress, address, mask, node.getNodeId().getValue(), sourceSegmentationId, destinationSegmentationId,
                          actionForNode, status);
         }
@@ -1476,15 +1477,34 @@ public class NeutronL3Adapter extends AbstractHandler implements GatewayMacResol
                         externalSubnet.getIpVersion() == 4 &&
                         gatewayPort.getFixedIPs() != null) {
                     LOG.info("Trigger MAC resolution for gateway ip {}", externalSubnet.getGatewayIP());
-
-                    gatewayMacResolver.resolveMacAddress(
+                    Neutron_IPs neutronIP = null;
+                    for (Neutron_IPs nIP : gatewayPort.getFixedIPs()) {
+                        InetAddress ipAddress;
+                        try {
+                            ipAddress = InetAddress.getByAddress(nIP.getIpAddress().getBytes());
+                        } catch (UnknownHostException e) {
+                            LOG.warn("unknown host exception {}", e);
+                            continue;
+                        }
+                        if (ipAddress instanceof Inet4Address) {
+                            neutronIP = nIP;
+                            break;
+                        }
+                    }
+                    if (neutronIP == null) {
+                        // TODO IPv6 neighbor discovery
+                        LOG.debug("Ignoring gateway ports with IPv6 only fixed ip {}",
+                                  gatewayPort.getFixedIPs());
+                    } else {
+                        gatewayMacResolver.resolveMacAddress(
                             this, /* gatewayMacResolverListener */
                             null, /* externalNetworkBridgeDpid */
                             true, /* refreshExternalNetworkBridgeDpidIfNeeded */
                             new Ipv4Address(externalSubnet.getGatewayIP()),
-                            new Ipv4Address(gatewayPort.getFixedIPs().get(0).getIpAddress()),
+                            new Ipv4Address(neutronIP.getIpAddress()),
                             new MacAddress(gatewayPort.getMacAddress()),
                             true /* periodicRefresh */);
+                    }
                 } else {
                     LOG.warn("No gateway IP address found for external network {}", externalNetwork);
                 }
index a50867d24515e19ac9823399033c8622ad348f3a..3e9c69ac385f9fc29509f0bde056cb9049fc1a4f 100644 (file)
@@ -101,7 +101,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal-binding-broker-impl</artifactId>
-      <version>1.3.0-SNAPSHOT</version>
       <type>test-jar</type>
       <scope>test</scope>
     </dependency>
index d3a7a05c347636fc4e0a2f0fe4dd0f6cea0ca118..33184082ca1860ea717c42682a2eaea425fd3d4c 100644 (file)
@@ -125,7 +125,7 @@ public class OvsdbConnectionInstance implements OvsdbClient {
                     }
                 }
             } catch (InterruptedException | ExecutionException e) {
-                LOG.warn("Exception attempting to createTransactionInvokers {}: {}",connectionInfo,e);
+                LOG.warn("Exception attempting to createTransactionInvokers {}", connectionInfo, e);
             }
         }
     }
@@ -180,7 +180,7 @@ public class OvsdbConnectionInstance implements OvsdbClient {
                                 ovs.getExternalIdsColumn().getData());
                 transaction.add(mutate);
             } catch (NullPointerException e) {
-                LOG.warn("Incomplete OVSDB Node external IDs");
+                LOG.warn("Incomplete OVSDB Node external IDs", e);
             }
 
 
index 0b4566b1552a145034051fd9477f69a2f869fffc..153bab5fc3fa3955d7f1582413b50c73c26fb840 100644 (file)
@@ -94,10 +94,11 @@ public class OvsdbConnectionManager implements OvsdbConnectionListener, AutoClos
                 externalClient.getConnectionInfo().getRemotePort(),
                 externalClient.getConnectionInfo().getLocalAddress(),
                 externalClient.getConnectionInfo().getLocalPort());
-        OvsdbConnectionInstance client = connectedButCallBacksNotRegistered(externalClient);
-
-        // Register Cluster Ownership for ConnectionInfo
-        registerEntityForOwnership(client);
+        if(externalClient.getSchema(SouthboundConstants.OPEN_V_SWITCH) != null) {
+            OvsdbConnectionInstance client = connectedButCallBacksNotRegistered(externalClient);
+            // Register Cluster Ownership for ConnectionInfo
+            registerEntityForOwnership(client);
+        }
     }
 
     public OvsdbConnectionInstance connectedButCallBacksNotRegistered(final OvsdbClient externalClient) {
index 7f858c39fbe723043fa27371bad09b0f6c483a05..9b3130b2a8c388b30bcc38cf0f1a005b828223e1 100644 (file)
@@ -240,7 +240,7 @@ public class SouthboundMapper {
             protocols = bridge.getProtocolsColumn().getData();
         } catch (SchemaVersionMismatchException e) {
             // We don't care about the exception stack trace here
-            LOG.warn("protocols not supported by this version of ovsdb: {}", e.getMessage());
+            LOG.warn("protocols not supported by this version of ovsdb", e);
         }
         List<ProtocolEntry> protocolList = new ArrayList<>();
         if (protocols != null && protocols.size() > 0) {
index 21f087b3008c52eb417f01e08e93d3b3b71e8424..a331a2ab5d6c83661d9df46d35a148ad9e70b757 100644 (file)
@@ -139,7 +139,7 @@ public class SouthboundProvider implements BindingAwareProvider, AutoCloseable {
                 transaction.cancel();
             }
         } catch (Exception e) {
-            LOG.error("Error initializing ovsdb topology {}",e);
+            LOG.error("Error initializing ovsdb topology", e);
         }
     }
 
index 7622ef47cdf7364886bb93d06b49b0fae48aa31e..6fe618438047d404c65d929e6f51db672c91f54f 100644 (file)
@@ -152,7 +152,7 @@ public class BridgeUpdateCommand extends AbstractTransactCommand {
             try {
                 bridge.setOtherConfig(ImmutableMap.copyOf(otherConfigMap));
             } catch (NullPointerException e) {
-                LOG.warn("Incomplete bridge other config");
+                LOG.warn("Incomplete bridge other config", e);
             }
         }
     }
index 3db0356abb701be90610b30bdc7b8b81d8e9da32..a36060cf246ad9b04328d9b78a8507482d5b6be6 100644 (file)
@@ -75,7 +75,7 @@ public class OvsdbNodeUpdateCommand implements TransactCommand {
                                 ovs.getExternalIdsColumn().getData());
                 transaction.add(mutate);
             } catch (NullPointerException e) {
-                LOG.warn("Incomplete OVSDB Node external IDs");
+                LOG.warn("Incomplete OVSDB Node external IDs", e);
             }
 
 
index 46d845ea74df3008ba42980bf58e87c516dc9b84..9f895600a1dd0b8ae943a2a95bf61d8e0261d32b 100644 (file)
@@ -112,7 +112,7 @@ public class QosUpdateCommand extends AbstractTransactCommand {
                 try {
                     qos.setExternalIds(ImmutableMap.copyOf(externalIdsMap));
                 } catch (NullPointerException e) {
-                    LOG.warn("Incomplete Qos external IDs");
+                    LOG.warn("Incomplete Qos external IDs", e);
                 }
 
                 List<QosOtherConfig> otherConfigs = qosEntry.getQosOtherConfig();
index 8cd6ab932170135f72c7965b317fbba4fe1910e3..1b991bbf16165c59b97130cec9fc8a9411c6c30c 100644 (file)
@@ -109,7 +109,7 @@ public class QueueUpdateCommand extends AbstractTransactCommand {
                 try {
                     queue.setExternalIds(ImmutableMap.copyOf(externalIdsMap));
                 } catch (NullPointerException e) {
-                    LOG.warn("Incomplete Queue external IDs");
+                    LOG.warn("Incomplete Queue external IDs", e);
                 }
 
                 List<QueuesOtherConfig> otherConfigs = queueEntry.getQueuesOtherConfig();
index 0cf2e33993afa6282b57137a23962489662ea778..ce3a1464376fac82265bd62b89080aa8cf4efd4b 100644 (file)
@@ -181,7 +181,7 @@ public class TerminationPointCreateCommand extends AbstractTransactCommand {
             try {
                 ovsInterface.setOptions(ImmutableMap.copyOf(optionsMap));
             } catch (NullPointerException e) {
-                LOG.warn("Incomplete OVSDB interface options");
+                LOG.warn("Incomplete OVSDB interface options", e);
             }
         }
     }
@@ -200,7 +200,7 @@ public class TerminationPointCreateCommand extends AbstractTransactCommand {
             try {
                 ovsInterface.setExternalIds(ImmutableMap.copyOf(externalIdsMap));
             } catch (NullPointerException e) {
-                LOG.warn("Incomplete OVSDB interface external_ids");
+                LOG.warn("Incomplete OVSDB interface external_ids", e);
             }
         }
     }
@@ -240,11 +240,11 @@ public class TerminationPointCreateCommand extends AbstractTransactCommand {
                 try {
                     ovsInterface.setLldp(ImmutableMap.copyOf(interfaceLldpMap));
                 } catch (NullPointerException e) {
-                    LOG.warn("Incomplete OVSDB interface lldp");
+                    LOG.warn("Incomplete OVSDB interface lldp", e);
                 }
             }
         } catch (SchemaVersionMismatchException e) {
-            LOG.debug("lldp column for Interface Table unsupported for this version of ovsdb schema. {}", e.getMessage());
+            LOG.debug("lldp column for Interface Table unsupported for this version of ovsdb schema", e);
         }
     }
 
@@ -261,7 +261,7 @@ public class TerminationPointCreateCommand extends AbstractTransactCommand {
             try {
                 port.setExternalIds(ImmutableMap.copyOf(externalIdsMap));
             } catch (NullPointerException e) {
-                LOG.warn("Incomplete OVSDB port external_ids");
+                LOG.warn("Incomplete OVSDB port external_ids", e);
             }
         }
     }
index abdbacf5b9a20b854d7b4c52d422e712e245e923..159161905fd26f9bfa851df82d9df96fced078ba 100644 (file)
@@ -173,7 +173,7 @@ public class TerminationPointUpdateCommand extends AbstractTransactCommand {
             try {
                 ovsInterface.setOptions(ImmutableMap.copyOf(optionsMap));
             } catch (NullPointerException e) {
-                LOG.warn("Incomplete OVSDB interface options");
+                LOG.warn("Incomplete OVSDB interface options", e);
             }
         }
     }
@@ -192,7 +192,7 @@ public class TerminationPointUpdateCommand extends AbstractTransactCommand {
             try {
                 ovsInterface.setExternalIds(ImmutableMap.copyOf(externalIdsMap));
             } catch (NullPointerException e) {
-                LOG.warn("Incomplete OVSDB interface external_ids");
+                LOG.warn("Incomplete OVSDB interface external_ids", e);
             }
         }
     }
@@ -212,11 +212,11 @@ public class TerminationPointUpdateCommand extends AbstractTransactCommand {
                 try {
                     ovsInterface.setLldp(ImmutableMap.copyOf(interfaceLldpMap));
                 } catch (NullPointerException e) {
-                    LOG.warn("Incomplete OVSDB interface lldp");
+                    LOG.warn("Incomplete OVSDB interface lldp", e);
                 }
             }
         } catch (SchemaVersionMismatchException e) {
-            LOG.debug("lldp column for Interface Table unsupported for this version of ovsdb schema. {}", e.getMessage());
+            LOG.debug("lldp column for Interface Table unsupported for this version of ovsdb schema", e);
         }
     }
 
@@ -253,7 +253,7 @@ public class TerminationPointUpdateCommand extends AbstractTransactCommand {
             try {
                 port.setExternalIds(ImmutableMap.copyOf(externalIdsMap));
             } catch (NullPointerException e) {
-                LOG.warn("Incomplete OVSDB port external_ids");
+                LOG.warn("Incomplete OVSDB port external_ids", e);
             }
         }
     }
index 47767f9da1f5c12613bcbc8ad0c3f854aaccdbb9..9ab33b7681d3f715d2ec2b2cdb40b3007b75db47 100644 (file)
@@ -355,7 +355,7 @@ public class OvsdbBridgeUpdateCommand extends AbstractTransactionCommand {
                         }
                     }
                 } catch (Exception e) {
-                    LOG.warn("Error getting local ip address {}", e);
+                    LOG.warn("Error getting local ip address", e);
                 }
             }
         }
index 735ae97251b141d348946aeb8e188b12140ca85a..674782e555ebdef5100af1a92956f4a2a466e3c3 100644 (file)
@@ -64,7 +64,7 @@ public class OvsdbNodeRemoveCommand extends AbstractTransactionCommand {
                 }
             }
         } catch (Exception e) {
-            LOG.warn("Failure to delete ovsdbNode {}",e);
+            LOG.warn("Failure to delete ovsdbNode", e);
         }
     }
 
index 36103416ca12c3f8a9a8a8f7db396daaab92e330..120ef5e6a5a60840174a4e1dc7e39517dae4410d 100644 (file)
@@ -468,6 +468,7 @@ public class OvsdbPortUpdateCommand extends AbstractTransactionCommand {
                 ovsdbTerminationPointBuilder.setInterfaceLldp(interfaceLldpList);
             }
         } catch (SchemaVersionMismatchException e) {
+            // We don't care about the exception stack trace here
             LOG.debug("lldp column for Interface Table unsupported for this version of ovsdb schema. {}", e.getMessage());
         }
     }
index f45c251a4f878872da7f2c71ca4520d91c8f2d8f..6ba2609281c806d8a70ad8b5ab653678b3f40ba0 100644 (file)
@@ -91,11 +91,7 @@ public class OvsdbQueueUpdateCommand extends AbstractTransactionCommand {
                 queuesBuilder.setQueueUuid(new Uuid(entry.getKey().toString()));
                 Collection<Long> dscp = queue.getDscpColumn().getData();
                 if (!dscp.isEmpty()) {
-                    try {
-                        queuesBuilder.setDscp(new Short(dscp.iterator().next().toString()));
-                    } catch (NumberFormatException e) {
-                        queuesBuilder.setDscp(new Short("0"));
-                    }
+                    queuesBuilder.setDscp(dscp.iterator().next().shortValue());
                 }
                 setOtherConfig(transaction, queuesBuilder, oldQueue, queue, nodeIId);
                 setExternalIds(transaction, queuesBuilder, oldQueue, queue, nodeIId);
index ae980bb8236c51ab4d314a1ce2446deb71ae9d50..010bcedb5a5348167496987ae47d16698e48afd8 100644 (file)
@@ -297,7 +297,7 @@ public class SouthboundIT extends AbstractMdsalTestBase {
         try {
             super.setup();
         } catch (Exception e) {
-            e.printStackTrace();
+            LOG.warn("Failed to setup test", e);
         }
         //dataBroker = getSession().getSALService(DataBroker.class);
         Thread.sleep(3000);
index 74fea32479bf269bc184ff771c0d5a82cb35227b..b8bd69a91198c5120e43a29fda23ce37f06ec9d9 100644 (file)
@@ -89,7 +89,7 @@ public class FlowUtils {
                 return data.get();
             }
         } catch (InterruptedException|ExecutionException e) {
-            LOG.error(e.getMessage(), e);
+            LOG.error("Failed to get flow {}", flowBuilder.getFlowName(), e);
         }
 
         LOG.info("Cannot find data for Flow {} in {}", flowBuilder.getFlowName(), store);
index 97d381f9abbf219e29e7f318f5b91fabed5ae408..ba8011004713fb6aaac3706a18952e7fb2fbfe3f 100644 (file)
@@ -107,6 +107,14 @@ public class MatchUtils {
     public static final short ALL_ICMP = -1;
     public static final long ETHERTYPE_IPV4 = 0x0800;
     public static final long ETHERTYPE_IPV6 = 0x86dd;
+    public static final int UNTRACKED_CT_STATE = 0x00;
+    public static final int UNTRACKED_CT_STATE_MASK = 0x20;
+    public static final int TRACKED_EST_CT_STATE = 0x22;
+    public static final int TRACKED_EST_CT_STATE_MASK = 0x22;
+    public static final int TRACKED_NEW_CT_STATE = 0x21;
+    public static final int TRACKED_NEW_CT_STATE_MASK = 0x21;
+    public static final int NEW_CT_STATE = 0x01;
+    public static final int NEW_CT_STATE_MASK = 0x01;
 
     /**
      * Create Ingress Port Match dpidLong, inPort
index 332c273a4b9b4ff58b34ff65cb3523821191140f..7abdbcfcad57596a1ac7b3be379d168dfeb8a694 100644 (file)
@@ -158,7 +158,7 @@ public class SouthboundUtils {
         try {
             inetAddress = InetAddress.getByName(addressStr);
         } catch (UnknownHostException e) {
-            LOG.warn("Could not allocate InetAddress");
+            LOG.warn("Could not allocate InetAddress", e);
         }
 
         IpAddress address = SouthboundMapper.createIpAddress(inetAddress);