Class: VagrantPlugins::VagrantVmwareDhcp::Action::SetMac

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-vmware-dhcp/action/set_mac.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ SetMac

Returns a new instance of SetMac.



8
9
10
11
12
# File 'lib/vagrant-vmware-dhcp/action/set_mac.rb', line 8

def initialize(app, env)
  @app       = app
  @env       = env
  @logger    = Log4r::Logger.new("vagrant::plugins::vagrant-vmware-dhcp::set_mac")
end

Instance Method Details

#call(env) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/vagrant-vmware-dhcp/action/set_mac.rb', line 14

def call(env)
  @env = env

  if @env[:machine]
    if (@env[:machine].provider_name == :vmware_fusion or @env[:machine].provider_name == :vmware_workstation)
      set_mac_address(@env)
    end
  end

  @app.call(@env)
end