diff options
author | Josh Cooper <josh+github@puppetlabs.com> | 2012-03-06 15:53:08 -0800 |
---|---|---|
committer | Josh Cooper <josh+github@puppetlabs.com> | 2012-03-06 15:53:08 -0800 |
commit | 32bad79d88e4464cb91101e4671874c11f3e5bf2 (patch) | |
tree | dc951630d4c7c4b9f0b49793ebed3b782c903b0c /lib | |
parent | c0ac470e764841b0de88dbabade342dc2c1b193e (diff) | |
parent | afd22ddc99af306aa476be7eaf9f02ada941c97b (diff) |
Merge pull request #45 from jeffmccune/ticket/2.3.x/12357_disable_root_home_fact_on_windows
(#12357) Fix root_home fact on Windows
Diffstat (limited to 'lib')
-rw-r--r-- | lib/facter/root_home.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/facter/root_home.rb b/lib/facter/root_home.rb index 61fcf39..8249f7d 100644 --- a/lib/facter/root_home.rb +++ b/lib/facter/root_home.rb @@ -7,7 +7,9 @@ module Facter::Util::RootHome def get_root_home root_ent = Facter::Util::Resolution.exec("getent passwd root") # The home directory is the sixth element in the passwd entry - root_ent.split(":")[5] + # If the platform doesn't have getent, root_ent will be nil and we should + # return it straight away. + root_ent && root_ent.split(":")[5] end end end |