Skip to content

Commit

Permalink
remove dependency on ping gem due to ruby 2.0 decomission
Browse files Browse the repository at this point in the history
instead use os level ping and process exit status
  • Loading branch information
rismoney committed Mar 6, 2014
1 parent 7ae3e4a commit d97af03
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/puppet/provider/ipconfig/ipconfig.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require File.join(File.dirname(__FILE__), '..', 'winnetwork')
require 'ping'
WOW64_64 = 0x100 unless defined?(WOW64_64)
WOW64_32 = 0x200 unless defined?(WOW64_32)

Expand Down Expand Up @@ -118,8 +117,9 @@ def defaultgateway= newvalue
end

self.backoff(5).each do |sleeptime|
foo = Ping.pingecho(@resource[:defaultgateway].to_s, 10)
foo ? break : sleep(sleeptime)
result = %x(ping -n 1 #{@resource[:defaultgateway].to_s})
ec = $?.exitstatus
ec == 0 ? break : sleep(sleeptime)
end
end

Expand Down

0 comments on commit d97af03

Please sign in to comment.