ONOS-1791 : Populates MPLS rules also at edge routers
 - Adds check for mastership when updating group description.

Change-Id: I536bcec595b8727689de11eb41e4b2f86cabb936
diff --git a/core/store/dist/src/main/java/org/onosproject/store/group/impl/DistributedGroupStore.java b/core/store/dist/src/main/java/org/onosproject/store/group/impl/DistributedGroupStore.java
index 068582c..5c92ef6 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/group/impl/DistributedGroupStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/group/impl/DistributedGroupStore.java
@@ -463,8 +463,8 @@
                                        GroupBuckets newBuckets,
                                        GroupKey newAppCookie) {
         // Check if group update to be done by a remote instance
-        if (mastershipService.
-                getLocalRole(deviceId) != MastershipRole.MASTER) {
+        if (mastershipService.getMasterFor(deviceId) != null &&
+                mastershipService.getLocalRole(deviceId) != MastershipRole.MASTER) {
             GroupStoreMessage groupOp = GroupStoreMessage.
                     createGroupUpdateRequestMsg(deviceId,
                                                 oldAppCookie,