Class: Vagrant::Action::VM::MatchMACAddress
- Inherits:
-
Object
- Object
- Vagrant::Action::VM::MatchMACAddress
- Defined in:
- lib/vagrant/action/vm/match_mac_address.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ MatchMACAddress
constructor
A new instance of MatchMACAddress.
Constructor Details
#initialize(app, env) ⇒ MatchMACAddress
Returns a new instance of MatchMACAddress.
5 6 7 |
# File 'lib/vagrant/action/vm/match_mac_address.rb', line 5 def initialize(app, env) @app = app end |
Instance Method Details
#call(env) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/vagrant/action/vm/match_mac_address.rb', line 9 def call(env) raise Errors::VMBaseMacNotSpecified if !env[:vm].config.vm.base_mac # Create the proc which we want to use to modify the virtual machine 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 |