Sha256: f32e43202b15a321b0b6c5e0ba15cb2900f1c29a6d4afe0d5a8858e4ad12cbb2

Contents?: true

Size: 452 Bytes

Versions: 56

Compression:

Stored size: 452 Bytes

Contents

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

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

          # If we got this far, there are no addressable IPs
          return nil
        end
      end
    end
  end
end

Version data entries

56 entries across 52 versions & 6 rubygems

Version Path
vagrant-unbundled-1.9.8.1 plugins/guests/darwin/cap/choose_addressable_ip_addr.rb
vagrant-unbundled-1.9.7.1 plugins/guests/darwin/cap/choose_addressable_ip_addr.rb
vagrant-aws-mkubenka-0.7.2.pre.14 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/guests/darwin/cap/choose_addressable_ip_addr.rb
vagrant-aws-mkubenka-0.7.2.pre.11 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/guests/darwin/cap/choose_addressable_ip_addr.rb
vagrant-aws-mkubenka-0.7.2.pre.10 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/guests/darwin/cap/choose_addressable_ip_addr.rb
vagrant-aws-mkubenka-0.7.2.pre.9 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/guests/darwin/cap/choose_addressable_ip_addr.rb
vagrant-unbundled-1.9.5.1 plugins/guests/darwin/cap/choose_addressable_ip_addr.rb
vagrant-unbundled-1.9.1.1 plugins/guests/darwin/cap/choose_addressable_ip_addr.rb
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/guests/darwin/cap/choose_addressable_ip_addr.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/guests/darwin/cap/choose_addressable_ip_addr.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/guests/darwin/cap/choose_addressable_ip_addr.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/guests/darwin/cap/choose_addressable_ip_addr.rb
vagrant-unbundled-1.8.5.2 plugins/guests/darwin/cap/choose_addressable_ip_addr.rb
vagrant-unbundled-1.8.5.1 plugins/guests/darwin/cap/choose_addressable_ip_addr.rb
vagrant-unbundled-1.8.4.2 plugins/guests/darwin/cap/choose_addressable_ip_addr.rb
vagrant-unbundled-1.8.4.1 plugins/guests/darwin/cap/choose_addressable_ip_addr.rb