Ensure devices are marked online during mastership check

Change-Id: I421739d14d7fe71821ac3c0c6c3002d93ee58527
diff --git a/core/net/src/main/java/org/onosproject/net/device/impl/DeviceManager.java b/core/net/src/main/java/org/onosproject/net/device/impl/DeviceManager.java
index 513e648..31ab8f8 100644
--- a/core/net/src/main/java/org/onosproject/net/device/impl/DeviceManager.java
+++ b/core/net/src/main/java/org/onosproject/net/device/impl/DeviceManager.java
@@ -498,6 +498,11 @@
                 continue;
             }
 
+            // If this node is the master, ensure the device is marked online.
+            if (myRole == MASTER) {
+                post(store.markOnline(deviceId));
+            }
+
             if (myRole != NONE) {
                 continue;
             }