Sha256: d9b7124b36ca8f923613b1146541ca68791b34451727c860f2179abd5231a039

Contents?: true

Size: 1.07 KB

Versions: 3

Compression:

Stored size: 1.07 KB

Contents

require 'vagrant/driver/virtualbox_base'
require 'vagrant/driver/virtualbox'


module Vagrant
  module Driver

    class VirtualBox_4_1 < VirtualBoxBase
      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
    end

    class VirtualBox_4_0 < VirtualBoxBase
      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
    end

    class VirtualBox < VirtualBoxBase
      def_delegator :@driver, :read_mac_addresses
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vagrant-windows-0.1.1 lib/vagrant-windows/monkey_patches/driver.rb
vagrant-windows-0.1.0 lib/vagrant-windows/monkey_patches/driver.rb
vagrant-windows-0.0.3 lib/vagrant-windows/monkey_patches/driver.rb