puppetlabs/puppetlabs-stdlib — pull request #42 by jeffmccune (2012-03-06 23:35:50+00:00)
Title: (#12357) Fix root_home fact on Windows

Without this patch the root_home fact fails on windows. This patch
fixes the problem by only calling methods on the object returned by the
`getent passwd root` command if the object evaluates to true.

Because there is no root account on Windows the code block simply
returns `nil` which makes the Facter fact undefined on Windows
platforms.

The root cause of the failure is that we always expected the command to
succeed and return something useful, and it may not on all supported
platforms.

Closes: GH-39