You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2014/04/21 20:05:24 UTC

svn commit: r1588945 - /hbase/trunk/hbase-shell/src/main/ruby/shell/commands/whoami.rb

Author: apurtell
Date: Mon Apr 21 18:05:24 2014
New Revision: 1588945

URL: http://svn.apache.org/r1588945
Log:
HBASE-11044 [Shell] Show groups for user in 'whoami' output

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

Modified: hbase/trunk/hbase-shell/src/main/ruby/shell/commands/whoami.rb
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-shell/src/main/ruby/shell/commands/whoami.rb?rev=1588945&r1=1588944&r2=1588945&view=diff
==============================================================================
--- hbase/trunk/hbase-shell/src/main/ruby/shell/commands/whoami.rb (original)
+++ hbase/trunk/hbase-shell/src/main/ruby/shell/commands/whoami.rb Mon Apr 21 18:05:24 2014
@@ -30,7 +30,12 @@ EOF
       end
 
       def command()
-        puts "#{org.apache.hadoop.hbase.security.User.getCurrent().toString()}"
+        user = org.apache.hadoop.hbase.security.User.getCurrent()
+        puts "#{user.toString()}"
+        groups = user.getGroupNames().to_a
+        if not groups.nil? and groups.length > 0
+          puts "    groups: #{groups.join(', ')}"
+        end
       end
     end
   end