Ensure devices are marked online during mastership check

Change-Id: I421739d14d7fe71821ac3c0c6c3002d93ee58527
(cherry picked from commit 8ac0247267b705340f4110b5853d2fbac6a010d6)
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 0f0069e..6ce7c0c 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;
             }