Class: VagrantPlugins::VagrantVmwareDhcp::Action::PruneDhcp

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

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ PruneDhcp

Returns a new instance of PruneDhcp.



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

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

Instance Method Details

#call(env) ⇒ Object



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

def call(env)
  @env = env

  if @env[:machine]
    if @env[:machine].provider_name == :vmware_fusion or @env[:machine].provider_name == :vmware_workstation
      @env[:ui].info("Pruning altered DHCP configuration")
      prune_dhcp(@env[:machine])
    end
  end

  @app.call(@env)
end