Add read_mac_addresses to 4.2 VirtualBox driver [GH-1690]
This commit is contained in:
parent
7fd363a2f4
commit
1841723478
|
@ -326,6 +326,19 @@ module VagrantPlugins
|
|||
nil
|
||||
end
|
||||
|
||||
def read_mac_addresses
|
||||
macs = {}
|
||||
info = execute("showvminfo", @uuid, "--machinereadable", :retryable => true)
|
||||
info.split("\n").each do |line|
|
||||
if matcher = /^macaddress(\d+)="(.+?)"$/.match(line)
|
||||
adapter = matcher[1].to_i
|
||||
mac = matcher[2].to_s
|
||||
macs[adapter] = mac
|
||||
end
|
||||
end
|
||||
macs
|
||||
end
|
||||
|
||||
def read_machine_folder
|
||||
execute("list", "systemproperties", :retryable => true).split("\n").each do |line|
|
||||
if line =~ /^Default machine folder:\s+(.+?)$/i
|
||||
|
|
Loading…
Reference in New Issue