Sha256: bde0af9fc8cf4f53dda39e2ee47d89f5a88d81d6b788e97639aa3f780a9dea75

Contents?: true

Size: 449 Bytes

Versions: 7

Compression:

Stored size: 449 Bytes

Contents

module VagrantPlugins
  module GuestLinux
    module Cap
      module ChooseAddressableIPAddr
        def self.choose_addressable_ip_addr(machine, possible)
          machine.communicate.tap do |comm|
            possible.each do |ip|
              command = "ping -c1 -w1 -W1 #{ip}"
              if comm.test(command)
                return ip
              end
            end
          end

          nil
        end
      end
    end
  end
end

Version data entries

7 entries across 4 versions & 3 rubygems

Version Path
vagrant-unbundled-1.8.1.2 plugins/guests/linux/cap/choose_addressable_ip_addr.rb
vagrant-unbundled-1.8.1.1 plugins/guests/linux/cap/choose_addressable_ip_addr.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-272fb27e0536/plugins/guests/linux/cap/choose_addressable_ip_addr.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-b421af58e8b3/plugins/guests/linux/cap/choose_addressable_ip_addr.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-309e896975d1/plugins/guests/linux/cap/choose_addressable_ip_addr.rb
vagrant-cloudstack-1.1.0 vendor/bundle/bundler/gems/vagrant-1cf2a8db4ccb/plugins/guests/linux/cap/choose_addressable_ip_addr.rb
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/bundler/gems/vagrant-1e28f1ac31e7/plugins/guests/linux/cap/choose_addressable_ip_addr.rb