lib/vagrant/action/vm/match_mac_address.rb in vagrantup-0.8.10 vs lib/vagrant/action/vm/match_mac_address.rb in vagrantup-0.9.0
- old
+ new
@@ -1,23 +1,18 @@
module Vagrant
- class Action
+ module Action
module VM
class MatchMACAddress
def initialize(app, env)
@app = app
end
def call(env)
- raise Errors::VMBaseMacNotSpecified if !env.env.config.vm.base_mac
+ raise Errors::VMBaseMacNotSpecified if !env[:vm].config.vm.base_mac
# Create the proc which we want to use to modify the virtual machine
- proc = lambda do |vm|
- env.ui.info I18n.t("vagrant.actions.vm.match_mac.matching")
- vm.network_adapters.first.mac_address = env["config"].vm.base_mac
- end
-
- # Add the proc to the modification chain
- env["vm.modify"].call(proc)
+ env[:ui].info I18n.t("vagrant.actions.vm.match_mac.matching")
+ env[:vm].driver.set_mac_address(env[:vm].config.vm.base_mac)
@app.call(env)
end
end
end