MD-SAL Statistics Manager - Did temporary fix for avoiding CSIT test failure. 20/3120/1
authorAnil Vishnoi <avishnoi@in.ibm.com>
Wed, 27 Nov 2013 11:30:51 +0000 (17:00 +0530)
committerAnil Vishnoi <avishnoi@in.ibm.com>
Wed, 27 Nov 2013 11:30:51 +0000 (17:00 +0530)
This code has dependency on openflowplugin code that is not yet merged.
http://git.opendaylight.org/gerrit/3037

Change-Id: Ia54a911d12f7a484a3475d93dc1b344478121006
Signed-off-by: Anil Vishnoi <avishnoi@in.ibm.com>
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatisticsProvider.java

index 5534c0458a9d55409ab677d81d31443434a1d749..d1ab3515035dfb0b5597c263c5f23ac29656d659 100644 (file)
@@ -127,6 +127,9 @@ public class StatisticsProvider implements AutoCloseable {
         
         //Need to call API to receive all the nodes connected to controller.
         List<Node> targetNodes = getAllConnectedNodes();
+        
+        if(targetNodes == null)
+            return;
 
         for (Node targetNode : targetNodes){
             spLogger.info("Send request for stats collection to node : {})",targetNode.getId());
@@ -215,6 +218,9 @@ public class StatisticsProvider implements AutoCloseable {
     private List<Node> getAllConnectedNodes(){
         
         Nodes nodes = (Nodes) dps.readOperationalData(nodesIdentifier);
+        if(nodes == null)
+            return null;
+        
         spLogger.info("Number of connected nodes : {}",nodes.getNode().size());
         return nodes.getNode();
     }