Class: VagrantPlugins::VagrantVmwareDhcp::DhcpManager

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

Instance Method Summary collapse

Constructor Details

#initialize(ui, logger, machine) ⇒ DhcpManager

Returns a new instance of DhcpManager.



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

def initialize(ui, logger, machine)
  @ui = ui
  @logger = logger
  @machine = machine
  @network_map = make_network_map(machine)
end

Instance Method Details

#configureObject



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/vagrant-vmware-dhcp/dhcp_manager/dhcp_manager.rb', line 26

def configure()
  @network_map.each {
    |mac, network|

    @ui.info("Configuring DHCP for #{network[:ip]} on #{network[:vnet]}")

    write_configuration(network)
  }

  @ui.info("DHCP Configured")
end

#pruneObject



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

def prune()
  @network_map.each {
    |mac, network|

    prune_configuration(network)
  }

  reload_configuration
end

#reloadObject



38
39
40
41
# File 'lib/vagrant-vmware-dhcp/dhcp_manager/dhcp_manager.rb', line 38

def reload()
  @ui.info("Reloading DHCP Configuration")
  reload_configuration
end