Repository: incubator-ranger
Updated Branches:
  refs/heads/master 658f2310d -> 63c547296


RANGER-827: Add default value for min group id to support existing deployments 
without any config changes

Signed-off-by: Velmurugan Periasamy <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/63c54729
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/63c54729
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/63c54729

Branch: refs/heads/master
Commit: 63c54729603323d8b625ae6941aea0abe80df2b3
Parents: 658f231
Author: Velmurugan Periasamy <[email protected]>
Authored: Thu Feb 11 18:07:14 2016 -0500
Committer: Velmurugan Periasamy <[email protected]>
Committed: Thu Feb 11 18:38:32 2016 -0500

----------------------------------------------------------------------
 .../ranger/unixusersync/config/UserGroupSyncConfig.java  | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/63c54729/ugsync/src/main/java/org/apache/ranger/unixusersync/config/UserGroupSyncConfig.java
----------------------------------------------------------------------
diff --git 
a/ugsync/src/main/java/org/apache/ranger/unixusersync/config/UserGroupSyncConfig.java
 
b/ugsync/src/main/java/org/apache/ranger/unixusersync/config/UserGroupSyncConfig.java
index 9bcf767..43cd982 100644
--- 
a/ugsync/src/main/java/org/apache/ranger/unixusersync/config/UserGroupSyncConfig.java
+++ 
b/ugsync/src/main/java/org/apache/ranger/unixusersync/config/UserGroupSyncConfig.java
@@ -60,7 +60,8 @@ public class UserGroupSyncConfig  {
        public static final String  UGSYNC_MIN_USERID_PROP  =   
"ranger.usersync.unix.minUserId" ;
 
        public static final String  UGSYNC_MIN_GROUPID_PROP =   
"ranger.usersync.unix.minGroupId" ;
-       
+        public static final String  DEFAULT_UGSYNC_MIN_GROUPID =   "0" ;
+        
        public static final String  UGSYNC_MAX_RECORDS_PER_API_CALL_PROP  =     
"ranger.usersync.policymanager.maxrecordsperapicall" ;
 
        public static final String  UGSYNC_MOCK_RUN_PROP  =     
"ranger.usersync.policymanager.mockrun" ;
@@ -370,7 +371,13 @@ public class UserGroupSyncConfig  {
                return prop.getProperty(UGSYNC_MIN_USERID_PROP) ;
        }
 
-       public String getMinGroupId() { return 
prop.getProperty(UGSYNC_MIN_GROUPID_PROP) ; }
+       public String getMinGroupId() { 
+                String mgid = prop.getProperty(UGSYNC_MIN_GROUPID_PROP);
+                if (mgid == null) {
+                    mgid = DEFAULT_UGSYNC_MIN_GROUPID;
+                }
+                return mgid;
+        }
        
        public String getMaxRecordsPerAPICall() {
                return prop.getProperty(UGSYNC_MAX_RECORDS_PER_API_CALL_PROP) ;

Reply via email to