summaryrefslogtreecommitdiff
path: root/lib/facter/root_home.rb
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2015-01-27 15:14:18 -0500
committerMicah Anderson <micah@riseup.net>2015-01-27 15:14:18 -0500
commit71123634744b9fe2ec7d6a3e38e9789fd84801e3 (patch)
tree1794e812d83facd93b3007c42632c63ddf1eb2fc /lib/facter/root_home.rb
parent71cb0f4c2c3bf95f62c9f189f5cef155b09a9682 (diff)
parent5863ab3901368310186790980aea2b0bf7cecb06 (diff)
Merge branch 'master' into leap
Diffstat (limited to 'lib/facter/root_home.rb')
-rw-r--r--lib/facter/root_home.rb13
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