Fixes #8788 - DHCP not detecting pingable addresses on Windows

Creates a Windows specific ping command and outputs to NUL.  Otherwise defaults to a Linux style ping.
I don't think it ever worked on windows.  I just checked my 2003 and 2012
servers and the syntax is the same as 2008.

On Wed, Dec 24, 2014 at 1:30 AM, Ohad Levy <notifications@github.com> wrote:

> In modules/dhcp/subnet.rb
> <https://github.com/theforeman/smart-proxy/pull/242#discussion-diff-22247926>
> :
>
> > @@ -277,7 +277,13 @@ def tcp_pingable? ip
> >
> >      def icmp_pingable? ip
> >        # Always shell to ping, instead of using net-ping
> > -      system("ping -c 1 -W 1 #{ip} > /dev/null")
> > +	  if PLATFORM =~ /mingw/
> > +	    # Windows uses different options for ping and does not have /dev/null
> > +	    system("ping -n 1 -w 1 #{ip} > NUL")
> > +	  else
> > +	    # Default to Linux ping options and send to /dev/null
> > +	    system("ping -c 1 -W 1 #{ip} > /dev/null")
>
> AFAIR this used to work on windows, did the syntax changed based on the OS
> version? e.g. do we need to have another condition based on the windows
> version?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/theforeman/smart-proxy/pull/242/files#r22247926>.
>