HBASE-11044 [Shell] Show groups for user in 'whoami' output

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1588945 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew Kyle Purtell 2014-04-21 18:05:24 +00:00
parent 3511399ca7
commit bdc2d1f831
1 changed files with 6 additions and 1 deletions

View File

@ -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