Skip to content

(#12357) Fix root_home fact on Windows#45

Merged
joshcooper merged 1 commit intopuppetlabs:2.3.xfrom
jeffmccune:ticket/2.3.x/12357_disable_root_home_fact_on_windows
Mar 6, 2012
Merged

(#12357) Fix root_home fact on Windows#45
joshcooper merged 1 commit intopuppetlabs:2.3.xfrom
jeffmccune:ticket/2.3.x/12357_disable_root_home_fact_on_windows

Conversation

@jeffmccune
Copy link
Copy Markdown
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
Copy Markdown
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