diff options
author | Josh Cooper <josh@puppetlabs.com> | 2011-07-29 13:30:15 -0700 |
---|---|---|
committer | Jacob Helwig <jacob@puppetlabs.com> | 2011-08-19 13:52:58 -0700 |
commit | 7259e1e5877b81dc5fd9b6ff090a4cccfc37c2f4 (patch) | |
tree | f8cac3bfd6c3142c4fd9619e1cdc463a22a2a9de /lib/puppet/provider/host/parsed.rb | |
parent | 328eaa2f7fd07ac7059e62d30064ef4b70f1f89f (diff) | |
download | puppet-7259e1e5877b81dc5fd9b6ff090a4cccfc37c2f4.tar.gz puppet-7259e1e5877b81dc5fd9b6ff090a4cccfc37c2f4.tar.xz puppet-7259e1e5877b81dc5fd9b6ff090a4cccfc37c2f4.zip |
(#8644) Host provider on Windows
The host provider did not work on Windows because it didn't know where
to find its hosts file. The provider now uses Win32::Resolv, which is
part of the standard ruby library, to find it.
Several host type/provider spec tests were marked as fails_on_windows,
but now that the provider is working, I removed the tag from those
tests, and verified that the tests now pass. There are two tests in
resources_spec that fail because the user and exec providers are not
supported on Windows yet, so those tests are marked as fails_on_windows.
Reviewed-by: Pieter van de Bruggen <pieter@puppetlabs.com>
(cherry picked from commit 82c6b3cb41397c989c011cf767066bcf1e403db2)
Diffstat (limited to 'lib/puppet/provider/host/parsed.rb')
-rw-r--r-- | lib/puppet/provider/host/parsed.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/puppet/provider/host/parsed.rb b/lib/puppet/provider/host/parsed.rb index 2ba01a41c..1a2bdb460 100644 --- a/lib/puppet/provider/host/parsed.rb +++ b/lib/puppet/provider/host/parsed.rb @@ -3,6 +3,9 @@ require 'puppet/provider/parsedfile' hosts = nil case Facter.value(:operatingsystem) when "Solaris"; hosts = "/etc/inet/hosts" +when "windows" + require 'win32/resolv' + hosts = Win32::Resolv.get_hosts_path else hosts = "/etc/hosts" end |