Add read_mac_addresses to 4.2 VirtualBox driver [GH-1690]

This commit is contained in:
Mitchell Hashimoto 2013-07-20 00:02:05 -04:00
parent 7fd363a2f4
commit 1841723478
1 changed files with 13 additions and 0 deletions

View File

@ -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