Sha256: bcc5f3892126ab56a0fd0464775d8311f88c71143416e096fa9f84154d9756af

Contents?: true

Size: 417 Bytes

Versions: 6

Compression:

Stored size: 417 Bytes

Contents

module VagrantPlugins
  module GuestLinux
    module Cap
      module ChooseAddressableIPAddr
        def self.choose_addressable_ip_addr(machine, possible)
          comm = machine.communicate

          possible.each do |ip|
            command = "ping -c1 -w1 -W1 #{ip}"
            if comm.test(command)
              return ip
            end
          end

          nil
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/guests/linux/cap/choose_addressable_ip_addr.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/guests/linux/cap/choose_addressable_ip_addr.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/guests/linux/cap/choose_addressable_ip_addr.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/guests/linux/cap/choose_addressable_ip_addr.rb
vagrant-unbundled-1.8.4.2 plugins/guests/linux/cap/choose_addressable_ip_addr.rb
vagrant-unbundled-1.8.4.1 plugins/guests/linux/cap/choose_addressable_ip_addr.rb