Yuta HIGUCHI
Committed by Gerrit Code Review

OpenFlowDeviceProvider: tolerate initial switch-add failures

- Initial switch add error should not prevent OFDProvider from activating

Change-Id: Id965aeaf8262a8b6a06c7d3f4af15593660f2f06
......@@ -92,7 +92,14 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
providerService = providerRegistry.register(this);
controller.addListener(listener);
for (OpenFlowSwitch sw : controller.getSwitches()) {
listener.switchAdded(new Dpid(sw.getId()));
try {
listener.switchAdded(new Dpid(sw.getId()));
} catch (Exception e) {
LOG.warn("Failed initially adding {} : {}", sw.getStringId(), e.getMessage());
LOG.debug("Error details:", e);
// disconnect to trigger switch-add later
sw.disconnectSwitch();
}
}
LOG.info("Started");
}
......