Skip to content

(#12357) Fix root_home fact on Windows #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

jeffmccune
Copy link
Contributor

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.

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.
@jeffmccune
Copy link
Contributor Author

Previous pull request: #39

joshcooper added a commit that referenced this pull request Mar 6, 2012
…t_home_fact_on_windows

(#12357) Fix root_home fact on Windows
@joshcooper joshcooper merged commit 32bad79 into puppetlabs:2.3.x Mar 6, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants