[ONOS-7751] Sometimes device availability is not changed to available after creation of OF device

Change-Id: I5fd62c598e865e149755b9d09594c985846a572b
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 09d95b4..b0f64f9 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
@@ -19,7 +19,6 @@
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Multimap;
-import com.google.common.util.concurrent.Futures;
 import org.apache.felix.scr.annotations.Activate;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Deactivate;
@@ -566,13 +565,11 @@
                 deviceDescription = deviceAnnotationOp.combine(deviceId, deviceDescription, Optional.of(annoConfig));
             }
 
+            MastershipRole role = mastershipService.requestRoleForSync(deviceId);
+            log.info("Local role is {} for {}", role, deviceId);
             DeviceEvent event = store.createOrUpdateDevice(provider().id(), deviceId,
-                                                           deviceDescription);
-            Futures.getUnchecked(mastershipService.requestRoleFor(deviceId)
-                                         .thenAccept(role -> {
-                                             log.info("Local role is {} for {}", role, deviceId);
-                                             applyRole(deviceId, role);
-                                         }));
+                    deviceDescription);
+            applyRole(deviceId, role);
 
             if (portConfig != null) {
                 //updating the ports if configration exists