diff options
author | Nick Lewis <nick@puppetlabs.com> | 2010-07-21 18:33:50 -0700 |
---|---|---|
committer | Nick Lewis <nick@puppetlabs.com> | 2010-07-21 18:33:50 -0700 |
commit | b2c21145885c15abc43b3641fcf903e13a859565 (patch) | |
tree | d30c370ab2ff75918d59620d083a4d81bd26a927 /lib/facter/ipaddress.rb | |
parent | 8106bc3f000d0e18969c4ec142ef84fbc780b30a (diff) | |
download | facter-b2c21145885c15abc43b3641fcf903e13a859565.tar.gz facter-b2c21145885c15abc43b3641fcf903e13a859565.tar.xz facter-b2c21145885c15abc43b3641fcf903e13a859565.zip |
Properly wrapped the windows ipaddress fact in a setcode block.
Diffstat (limited to 'lib/facter/ipaddress.rb')
-rw-r--r-- | lib/facter/ipaddress.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/facter/ipaddress.rb b/lib/facter/ipaddress.rb index 7c62aa1..a08f26b 100644 --- a/lib/facter/ipaddress.rb +++ b/lib/facter/ipaddress.rb @@ -111,8 +111,10 @@ end Facter.add(:ipaddress) do confine :kernel => %w{windows} - require 'socket' - IPSocket.getaddress(Socket.gethostname) + setcode do + require 'socket' + IPSocket.getaddress(Socket.gethostname) + end end Facter.add(:ipaddress, :ldapname => "iphostnumber", :timeout => 2) do |