Merge "Cleanup exception logging"
authorSam Hague <shague@redhat.com>
Fri, 19 Feb 2016 17:12:42 +0000 (17:12 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 19 Feb 2016 17:12:42 +0000 (17:12 +0000)
37 files changed:
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/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/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbConnectionInstance.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/southbound-utils/src/main/java/org/opendaylight/ovsdb/utils/southbound/utils/SouthboundUtils.java

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 f62411ca535e44d870fd995ff92c9d6b60daccc4..1869f49df48afac12111bf984363399c6bfe54b3 100644 (file)
@@ -276,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 32435ae336e17cbd8e06816ec28745eeefb72407..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);
                 }
             }
         }
index d5adb417374abb279d546cedd12894bd53554d32..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;
                 }
             }
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 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..7b36c95546069b700e5bdec0cf528d205d1f0266 100644 (file)
@@ -1214,12 +1214,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);
         }
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 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 3a8bb7280ab3450028d6595e520f917872836956..bfd3c9e9a9a21c51af142640c4c02d2ba3e66c72 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 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);