Fixing a recent breakage in Flow programmer introduced by https://git.opendaylight...
[controller.git] / opendaylight / protocol_plugins / openflow / src / main / java / org / opendaylight / controller / protocol_plugin / openflow / internal / InventoryServiceShim.java
index 6401ec52f81faba1694302314882affb0d818ca5..f4843cf8283f36f2dc4ae957c2e46c42d363e4d6 100644 (file)
@@ -26,8 +26,9 @@ import org.opendaylight.controller.protocol_plugin.openflow.core.IController;
 import org.opendaylight.controller.protocol_plugin.openflow.core.IMessageListener;
 import org.opendaylight.controller.protocol_plugin.openflow.core.ISwitch;
 import org.opendaylight.controller.protocol_plugin.openflow.core.ISwitchStateListener;
+import org.opendaylight.controller.sal.action.SupportedFlowActions;
+import org.opendaylight.controller.sal.connection.ConnectionLocality;
 import org.opendaylight.controller.sal.connection.IPluginOutConnectionService;
-import org.opendaylight.controller.sal.core.Actions;
 import org.opendaylight.controller.sal.core.Buffers;
 import org.opendaylight.controller.sal.core.Capabilities;
 import org.opendaylight.controller.sal.core.ContainerFlow;
@@ -259,7 +260,11 @@ public class InventoryServiceShim implements IContainerListener,
         }
 
         // Add this node
-        addNode(sw);
+        if (connectionOutService.getLocalityStatus(node) != ConnectionLocality.NOT_CONNECTED) {
+            addNode(sw);
+        } else {
+            logger.debug("Skipping node addition due to Connectivity Status : {}", connectionOutService.getLocalityStatus(node).name());
+        }
     }
 
     @Override
@@ -498,7 +503,7 @@ public class InventoryServiceShim implements IContainerListener,
             props.add(c);
         }
         int act = sw.getActions();
-        Actions a = new Actions(act);
+        SupportedFlowActions a = new SupportedFlowActions(FlowConverter.getFlowActions(act));
         if (a != null) {
             props.add(a);
         }