hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r1589492 - /hbase/trunk/hbase-shell/src/main/ruby/shell/commands/grant.rb
Date Wed, 23 Apr 2014 18:55:10 GMT
Author: apurtell
Date: Wed Apr 23 18:55:10 2014
New Revision: 1589492

URL: http://svn.apache.org/r1589492
Log:
Amend HBASE-11001 Shell support for granting cell permissions for testing; Fix global grants

Modified:
    hbase/trunk/hbase-shell/src/main/ruby/shell/commands/grant.rb

Modified: hbase/trunk/hbase-shell/src/main/ruby/shell/commands/grant.rb
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-shell/src/main/ruby/shell/commands/grant.rb?rev=1589492&r1=1589491&r2=1589492&view=diff
==============================================================================
--- hbase/trunk/hbase-shell/src/main/ruby/shell/commands/grant.rb (original)
+++ hbase/trunk/hbase-shell/src/main/ruby/shell/commands/grant.rb Wed Apr 23 18:55:10 2014
@@ -53,19 +53,20 @@ EOF
           permissions = args[1]
           raise(ArgumentError, "Permissions are not of String type") unless permissions.kind_of?(
             String)
-          table_name = args[2]
-          raise(ArgumentError, "Table name is not of String type") unless table_name.kind_of?(
-            String)
-          family = args[3]     # will be nil if unset
-          if not family.nil?
-            raise(ArgumentError, "Family is not of String type") unless family.kind_of?(String)
-            qualifier = args[4]  # will be nil if unset
-            if not qualifier.nil?
-              raise(ArgumentError, "Qualifier is not of String type") unless qualifier.kind_of?(
-                String)
+          table_name = family = qualifier = nil
+          table_name = args[2] # will be nil if unset
+          if not table_name.nil?
+            raise(ArgumentError, "Table name is not of String type") unless table_name.kind_of?(
+              String)
+            family = args[3]     # will be nil if unset
+            if not family.nil?
+              raise(ArgumentError, "Family is not of String type") unless family.kind_of?(String)
+              qualifier = args[4]  # will be nil if unset
+              if not qualifier.nil?
+                raise(ArgumentError, "Qualifier is not of String type") unless qualifier.kind_of?(
+                  String)
+              end
             end
-          else
-            qualifier = nil
           end
           format_simple_command do
             security_admin.grant(user, permissions, table_name, family, qualifier)
@@ -80,11 +81,9 @@ EOF
           # Useful for feature testing and debugging.
 
           permissions = args[1]
-          raise(ArgumentError, "Permissions are not of Hash type") unless
-            permissions.kind_of?(Hash)
+          raise(ArgumentError, "Permissions are not of Hash type") unless permissions.kind_of?(Hash)
           scan = args[2]
-          raise(ArgumentError, "Scanner specification is not a Hash") unless
-            scan.kind_of?(Hash)
+          raise(ArgumentError, "Scanner specification is not a Hash") unless scan.kind_of?(Hash)
 
           t = table(table_name)
           now = Time.now



Mime
View raw message