diff options
author | Andrew Parker <andy@puppetlabs.com> | 2014-01-28 10:52:58 -0800 |
---|---|---|
committer | Andrew Parker <andy@puppetlabs.com> | 2014-01-28 10:52:58 -0800 |
commit | a2e9d005c731e496d6ed3ce7ff68f50906929c2c (patch) | |
tree | 68d7ec6ed3b03844d40711409c1bccf603bcaac3 /lib | |
parent | 2c8450d830453e452b819bfb05678768336c3031 (diff) | |
parent | fe676f0ac4e1d96e77ba7fe894408d8e7647eacc (diff) | |
download | puppet-stdlib-a2e9d005c731e496d6ed3ce7ff68f50906929c2c.tar.gz puppet-stdlib-a2e9d005c731e496d6ed3ce7ff68f50906929c2c.tar.bz2 |
Merge pull request #215 from blkperl/add_root_home_to_mavericks
(PUP-1459) Add support for root_home on OS X 10.9
Diffstat (limited to 'lib')
-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 8249f7d..b4f87ff 100644 --- a/lib/facter/root_home.rb +++ b/lib/facter/root_home.rb @@ -17,3 +17,16 @@ end Facter.add(:root_home) do setcode { Facter::Util::RootHome.get_root_home } end + +Facter.add(:root_home) do + confine :kernel => :darwin + setcode do + str = Facter::Util::Resolution.exec("dscacheutil -q user -a name root") + hash = {} + str.split("\n").each do |pair| + key,value = pair.split(/:/) + hash[key] = value + end + hash['dir'].strip + end +end |