Added null check in FRM error handling and also formatting of OF ErrorMessage in... 84/1384/1
authorAsad Ahmed <asaahmed@cisco.com>
Mon, 23 Sep 2013 22:59:40 +0000 (15:59 -0700)
committerAsad Ahmed <asaahmed@cisco.com>
Mon, 23 Sep 2013 22:59:40 +0000 (15:59 -0700)
Change-Id: I2b32318284e74df51719786762499016831789ef
Signed-off-by: Asad Ahmed <asaahmed@cisco.com>
opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManager.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowProgrammerService.java

index e9a56d6113c1502447d5956b5bd6236e185ac26b..a6cdf2c466ab579986234f2a5a4c884fe8e7fd33 100644 (file)
@@ -3067,11 +3067,18 @@ public class ForwardingRulesManager implements
          * mapping will have to be added in future
          */
         FlowEntryInstall target = null;
-        for (FlowEntryInstall index : nodeFlows.get(node)) {
-            FlowEntryInstall entry = installedSwView.get(index);
-            if (entry.getRequestId() == rid) {
-                target = entry;
-                break;
+        List<FlowEntryInstall> flowEntryInstallList = nodeFlows.get(node);
+        // flowEntryInstallList could be null.
+        // so check for it.
+        if(flowEntryInstallList != null) {
+            for (FlowEntryInstall index : flowEntryInstallList) {
+                FlowEntryInstall entry = installedSwView.get(index);
+                if(entry != null) {
+                    if (entry.getRequestId() == rid) {
+                        target = entry;
+                        break;
+                    }
+                }
             }
         }
         if (target != null) {
index 88b75b196dcec8f370a6119130d21f3578aa89ab..b163c639a5c53d507988958ef04afc0b1d1d540f 100644 (file)
@@ -448,7 +448,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService,
         for (Map.Entry<String, IFlowProgrammerNotifier> containerNotifier : flowProgrammerNotifiers
                 .entrySet()) {
             IFlowProgrammerNotifier notifier = containerNotifier.getValue();
-            notifier.flowErrorReported(node, rid, errorMsg);
+            notifier.flowErrorReported(node, rid, Utils.getOFErrorString(errorMsg));
         }
     }