sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ak...@apache.org
Subject [11/12] sentry git commit: Help strings cleanup
Date Tue, 24 Jan 2017 23:03:33 GMT
Help strings cleanup


Project: http://git-wip-us.apache.org/repos/asf/sentry/repo
Commit: http://git-wip-us.apache.org/repos/asf/sentry/commit/6ae74f32
Tree: http://git-wip-us.apache.org/repos/asf/sentry/tree/6ae74f32
Diff: http://git-wip-us.apache.org/repos/asf/sentry/diff/6ae74f32

Branch: refs/heads/akolb-ha-cli
Commit: 6ae74f32aadc370c7be27f554806dfd3d286cf28
Parents: 25fbdb9
Author: Alexander Kolbasov <akolb@cloudera.com>
Authored: Thu Dec 15 16:20:23 2016 -0800
Committer: Alexander Kolbasov <akolb@cloudera.com>
Committed: Sun Jan 22 17:09:07 2017 -0800

----------------------------------------------------------------------
 .../java/org/apache/sentry/shell/GroupShell.java    |  9 +++++++--
 .../java/org/apache/sentry/shell/PrivsShell.java    |  6 ++----
 .../java/org/apache/sentry/shell/SentryCli.java     |  4 +++-
 .../java/org/apache/sentry/shell/TopLevelShell.java | 16 ++++++----------
 4 files changed, 18 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/6ae74f32/sentry-tools/src/main/java/org/apache/sentry/shell/GroupShell.java
----------------------------------------------------------------------
diff --git a/sentry-tools/src/main/java/org/apache/sentry/shell/GroupShell.java b/sentry-tools/src/main/java/org/apache/sentry/shell/GroupShell.java
index 3fc7a31..246509c 100644
--- a/sentry-tools/src/main/java/org/apache/sentry/shell/GroupShell.java
+++ b/sentry-tools/src/main/java/org/apache/sentry/shell/GroupShell.java
@@ -19,6 +19,7 @@
 package org.apache.sentry.shell;
 
 import com.budhash.cliche.Command;
+import com.budhash.cliche.Param;
 import com.budhash.cliche.Shell;
 import com.budhash.cliche.ShellDependent;
 import org.apache.sentry.provider.db.service.thrift.SentryPolicyServiceClient;
@@ -41,12 +42,16 @@ public class GroupShell implements ShellDependent {
     }
 
     @Command(description = "Grant role to groups")
-    public void grant(String roleName, String ...groups) {
+    public void grant(
+            @Param(name = "roleName") String roleName,
+            @Param(name = "group") String ...groups) {
         tools.grantGroupsToRole(roleName, groups);
     }
 
     @Command(description = "Revoke role from groups")
-    public void revoke(String roleName, String ...groups) {
+    public void revoke(
+            @Param(name = "roleName") String roleName,
+            @Param(name = "group") String ...groups) {
         tools.revokeGroupsFromRole(roleName, groups);
     }
 

http://git-wip-us.apache.org/repos/asf/sentry/blob/6ae74f32/sentry-tools/src/main/java/org/apache/sentry/shell/PrivsShell.java
----------------------------------------------------------------------
diff --git a/sentry-tools/src/main/java/org/apache/sentry/shell/PrivsShell.java b/sentry-tools/src/main/java/org/apache/sentry/shell/PrivsShell.java
index 9d8b9d9..2e12be8 100644
--- a/sentry-tools/src/main/java/org/apache/sentry/shell/PrivsShell.java
+++ b/sentry-tools/src/main/java/org/apache/sentry/shell/PrivsShell.java
@@ -47,15 +47,13 @@ public class PrivsShell implements ShellDependent {
 
     @Command
     public List<String> list(
-            @Param(name = "roleName")
-            String roleName) {
+            @Param(name = "roleName") String roleName) {
         return tools.listPrivileges(roleName);
     }
 
     @Command
     public void revoke(
-            @Param(name = "roleName")
-            String roleName,
+            @Param(name = "roleName") String roleName,
             @Param(name = "privilege",
                     description = "privilege string, e.g. server=s1->db=foo")
             String privilege) {

http://git-wip-us.apache.org/repos/asf/sentry/blob/6ae74f32/sentry-tools/src/main/java/org/apache/sentry/shell/SentryCli.java
----------------------------------------------------------------------
diff --git a/sentry-tools/src/main/java/org/apache/sentry/shell/SentryCli.java b/sentry-tools/src/main/java/org/apache/sentry/shell/SentryCli.java
index 180d240..36833c8 100644
--- a/sentry-tools/src/main/java/org/apache/sentry/shell/SentryCli.java
+++ b/sentry-tools/src/main/java/org/apache/sentry/shell/SentryCli.java
@@ -142,7 +142,7 @@ public class SentryCli {
                 log4jProperties.load(istream);
                 istream.close();
             } catch (IOException e) {
-                e.printStackTrace();
+                System.out.println(e.toString());
             }
 
             PropertyConfigurator.configure(log4jProperties);
@@ -170,6 +170,7 @@ public class SentryCli {
         }
 
         if (host != null) {
+            System.out.println("Connecting to " + host);
             conf.set(SERVER_RPC_ADDRESS, host);
         }
 
@@ -192,6 +193,7 @@ public class SentryCli {
             sentryClient = SentryServiceClientFactory.create(conf);
         } catch (Exception e) {
             System.out.println("Failed to connect to Sentry server: " + e.toString());
+            e.printStackTrace();
         }
     }
 

http://git-wip-us.apache.org/repos/asf/sentry/blob/6ae74f32/sentry-tools/src/main/java/org/apache/sentry/shell/TopLevelShell.java
----------------------------------------------------------------------
diff --git a/sentry-tools/src/main/java/org/apache/sentry/shell/TopLevelShell.java b/sentry-tools/src/main/java/org/apache/sentry/shell/TopLevelShell.java
index ef5313a..047f11c 100644
--- a/sentry-tools/src/main/java/org/apache/sentry/shell/TopLevelShell.java
+++ b/sentry-tools/src/main/java/org/apache/sentry/shell/TopLevelShell.java
@@ -72,8 +72,7 @@ public class TopLevelShell implements ShellDependent, Runnable {
 
     @Command(description = "List sentry roles by group")
     public List<String> listRoles(
-            @Param(name = "groupName")
-            String group) {
+            @Param(name = "groupName") String group) {
         return tools.listRoles(group);
     }
 
@@ -85,19 +84,16 @@ public class TopLevelShell implements ShellDependent, Runnable {
 
     @Command(description = "Grant role to groups")
     public void grantRole(
-            @Param(name = "roleName")
-            String roleName,
-            @Param(name = "group...") String ...groups) {
+            @Param(name = "roleName") String roleName,
+            @Param(name = "group") String ...groups) {
         tools.grantGroupsToRole(roleName, groups);
     }
 
     @Command(abbrev = "grm",
             description = "Revoke role from groups")
     public void revokeRole(
-            @Param(name = "roleName")
-            String roleName,
-            @Param(name = "group...")
-            String ...groups) {
+            @Param(name = "roleName") String roleName,
+            @Param(name = "group") String ...groups) {
         tools.revokeGroupsFromRole(roleName, groups);
     }
 
@@ -110,7 +106,7 @@ public class TopLevelShell implements ShellDependent, Runnable {
 
     @Command(abbrev = "rm", description = "remove Sentry role(s).")
     public void removeRole(
-            @Param(name = "roleName ...", description = "role names to remove")
+            @Param(name = "roleName", description = "role names to remove")
                     String ...roles) {
         tools.removeRoles(roles);
     }


Mime
View raw message