Module: Dockdev::UserInfo

Includes:
TR::CondUtils
Defined in:
lib/dockdev/user_info.rb

Class Method Summary collapse

Class Method Details

.group_info(login = nil) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/dockdev/user_info.rb', line 19

def self.group_info( = nil)
   = Etc.getlogin if is_empty?()
  res = {  }
  begin
    gnm = Etc.getgrnam()
    res[:group_name] = gnm.name
    res[:gid] = gnm.gid
  rescue Exception => ex
    p ex
    res[:group_name] = ""
    res[:gid] = nil
  end
  res
end

.user_info(login = nil) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/dockdev/user_info.rb', line 8

def self.( = nil)
   = Etc.getlogin if is_empty?()
  res = { login:  }
  begin
    res[:uid] = Etc.getpwnam().uid
  rescue Exception => ex
    res[:uid] = nil
  end
  res
end