ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject [19/26] incubator-ranger git commit: RANGER-755, 756, 757: ldaptool fixes (Sailaja Polavarapu via Velmurugan Periasamy)
Date Wed, 02 Dec 2015 23:19:35 GMT
RANGER-755,756,757: ldaptool fixes (Sailaja Polavarapu via Velmurugan Periasamy)

Signed-off-by: Velmurugan Periasamy <vel@apache.org>


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

Branch: refs/heads/tag-policy
Commit: 7ac6a02a3b12a453c03d9e5868010fda4fdfa61d
Parents: 19c2134
Author: Velmurugan Periasamy <vel@apache.org>
Authored: Tue Dec 1 14:19:41 2015 -0800
Committer: Velmurugan Periasamy <vel@apache.org>
Committed: Tue Dec 1 14:23:26 2015 -0800

----------------------------------------------------------------------
 .../ldapconfigcheck/scripts/run.sh                    |  8 ++++----
 .../ranger/ldapconfigcheck/CommandLineOptions.java    | 14 ++++++--------
 2 files changed, 10 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/7ac6a02a/ugsync/ldapconfigchecktool/ldapconfigcheck/scripts/run.sh
----------------------------------------------------------------------
diff --git a/ugsync/ldapconfigchecktool/ldapconfigcheck/scripts/run.sh b/ugsync/ldapconfigchecktool/ldapconfigcheck/scripts/run.sh
index 787e216..e5c313a 100755
--- a/ugsync/ldapconfigchecktool/ldapconfigcheck/scripts/run.sh
+++ b/ugsync/ldapconfigchecktool/ldapconfigcheck/scripts/run.sh
@@ -19,7 +19,7 @@ AUTH=1
 
 usage() {
   echo "usage: run.sh
- -noauth         ignore authentication properties
+ -a         ignore authentication properties
  -d <arg>   {all|users|groups}
  -h                       show help.
  -i <arg>            Input file name
@@ -33,7 +33,7 @@ cp="${cdir}/lib/*:${cdir}/conf"
 OUTDIR="${cdir}/output/"
 JAVA_CMD="java -cp ${cdir}/lib/ldapconfigcheck.jar:${cp} org.apache.ranger.ldapconfigcheck.LdapConfigCheckMain"
 
-while getopts "i:o:d:r:noauthh" opt; do
+while getopts "i:o:d:r:ah" opt; do
   case $opt in
     i) INFILE=$OPTARG
 	JAVA_CMD="$JAVA_CMD -i $OPTARG"
@@ -46,8 +46,8 @@ while getopts "i:o:d:r:noauthh" opt; do
     r) RETRIEVE=$OPTARG
 	JAVA_CMD="$JAVA_CMD -r $OPTARG"
 	;;
-    noauth) AUTH=0
-	JAVA_CMD="$JAVA_CMD -noauth"
+    a) AUTH=0
+	JAVA_CMD="$JAVA_CMD -a"
 	;;
     h) usage
 	;;

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/7ac6a02a/ugsync/ldapconfigchecktool/ldapconfigcheck/src/main/java/org/apache/ranger/ldapconfigcheck/CommandLineOptions.java
----------------------------------------------------------------------
diff --git a/ugsync/ldapconfigchecktool/ldapconfigcheck/src/main/java/org/apache/ranger/ldapconfigcheck/CommandLineOptions.java
b/ugsync/ldapconfigchecktool/ldapconfigcheck/src/main/java/org/apache/ranger/ldapconfigcheck/CommandLineOptions.java
index 790330f..c71e5cc 100644
--- a/ugsync/ldapconfigchecktool/ldapconfigcheck/src/main/java/org/apache/ranger/ldapconfigcheck/CommandLineOptions.java
+++ b/ugsync/ldapconfigchecktool/ldapconfigcheck/src/main/java/org/apache/ranger/ldapconfigcheck/CommandLineOptions.java
@@ -28,7 +28,7 @@ public class CommandLineOptions {
     private Options options = new Options();
     private String input = null;
     private String output = null;
-    private String discoverProperties;
+    private String discoverProperties = null;
     private String retrieveValues = null;
     private boolean isAuthEnabled = true;
     private String ldapUrl = "";
@@ -46,7 +46,7 @@ public class CommandLineOptions {
         options.addOption("o", "outputdir", true, "Output directory");
         options.addOption("d", "discoverProperties", true, "{all|users|groups}");
         options.addOption("r", "retrieve", true, "{all|users|groups}");
-        options.addOption("noauth", "noAuthentication", false, "Ignore authentication properties");
+        options.addOption("a", "noAuthentication", false, "Ignore authentication properties");
     }
 
     public void parse() {
@@ -72,9 +72,7 @@ public class CommandLineOptions {
                     System.out.println("Unsupported value for option d");
                     help();
                 }
-            }
-
-            if (cmd.hasOption("r")) {
+            } else if (cmd.hasOption("r")) {
                 retrieveValues = cmd.getOptionValue("r");
                 if (retrieveValues == null || (!retrieveValues.equalsIgnoreCase("all")
                         && !retrieveValues.equalsIgnoreCase("users") && !retrieveValues.equalsIgnoreCase("groups")))
{
@@ -82,15 +80,15 @@ public class CommandLineOptions {
                     help();
                 }
             } else {
-                if (discoverProperties == null || discoverProperties.isEmpty()) {
+                //if (discoverProperties == null || discoverProperties.isEmpty()) {
                     System.out.println("Default to discover all usersync properties");
                     //help();
                 	// If "d" or "r" option is not specified, then default to discover all usersync
properties
                 	discoverProperties = "all";
-                }
+                //}
             }
 
-            if (cmd.hasOption("noauth")) {
+            if (cmd.hasOption("a") || discoverProperties == null || (discoverProperties !=
null && !discoverProperties.equalsIgnoreCase("all"))) {
                 isAuthEnabled = false;
             }
             


Mime
View raw message