Module: HashiCorp::VagrantVMwareDesktop::Cap::Provider

Defined in:
lib/vagrant-vmware-desktop/cap/provider.rb

Class Method Summary collapse

Class Method Details

.forwarded_ports(machine) ⇒ Object



11
12
13
14
15
# File 'lib/vagrant-vmware-desktop/cap/provider.rb', line 11

def self.forwarded_ports(machine)
  path = machine.data_dir.join("forwarded_ports")
  return JSON.parse(path.read) if path.file?
  {}
end

.nic_mac_addresses(machine) ⇒ Object



30
31
32
# File 'lib/vagrant-vmware-desktop/cap/provider.rb', line 30

def self.nic_mac_addresses(machine)
  machine.provider.driver.read_mac_addresses
end

.public_address(machine) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/vagrant-vmware-desktop/cap/provider.rb', line 17

def self.public_address(machine)
  guest_ip = nil
  5.times do |_|
    guest_ip = machine.provider.driver.read_ip(
      machine.provider_config.enable_vmrun_ip_lookup
    )
    break if guest_ip
    sleep 2
  end

  guest_ip
end

.scrub_forwarded_ports(machine) ⇒ Object



34
35
36
# File 'lib/vagrant-vmware-desktop/cap/provider.rb', line 34

def self.scrub_forwarded_ports(machine)
  machine.provider.driver.scrub_forwarded_ports
end