diff options
author | varac <varacanero@zeromail.org> | 2017-01-13 12:41:58 +0100 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2017-01-13 12:41:58 +0100 |
commit | 066c08f8362d53f0f30897cb8710d11260c726ea (patch) | |
tree | a6369eecd88bb731fe413d0bbc8af73d74d1f447 /lib/facter/root_home.rb | |
parent | 71123634744b9fe2ec7d6a3e38e9789fd84801e3 (diff) | |
parent | b65dd1f45d10e10e45455358aeabb29167990e2c (diff) |
Merge remote-tracking branch 'origin/master' into leap_master
Diffstat (limited to 'lib/facter/root_home.rb')
-rw-r--r-- | lib/facter/root_home.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/facter/root_home.rb b/lib/facter/root_home.rb index b4f87ff..87c7657 100644 --- a/lib/facter/root_home.rb +++ b/lib/facter/root_home.rb @@ -30,3 +30,16 @@ Facter.add(:root_home) do hash['dir'].strip end end + +Facter.add(:root_home) do + confine :kernel => :aix + root_home = nil + setcode do + str = Facter::Util::Resolution.exec("lsuser -c -a home root") + str && str.split("\n").each do |line| + next if line =~ /^#/ + root_home = line.split(/:/)[1] + end + root_home + end +end |