From e4509d356a6f9d9b12d74a594c1ff4a86206d9c0 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sun, 30 Sep 2018 12:59:33 -0400 Subject: [PATCH] Set up DHCP config properly --- router-daemon/pvcrd/VXNetworkInstance.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/router-daemon/pvcrd/VXNetworkInstance.py b/router-daemon/pvcrd/VXNetworkInstance.py index 0548f7ab..02ad687d 100644 --- a/router-daemon/pvcrd/VXNetworkInstance.py +++ b/router-daemon/pvcrd/VXNetworkInstance.py @@ -48,7 +48,6 @@ class VXNetworkInstance(): self.vxlan_nic = 'vxlan{}'.format(self.vni) self.bridge_nic = 'br{}'.format(self.vni) - self.dhcp_reservations = {} self.firewall_rules = {} self.createNetwork() @@ -79,16 +78,21 @@ class VXNetworkInstance(): if data != None and self.dhcp_flag != data.decode('ascii'): self.dhcp_flag = ( data.decode('ascii') == 'True' ) if self.dhcp_flag: - self.dhcp_instance = DHCPServer.DHCPServer(self.vni, self.config) + dhcp_config = DHCPServer.DHCPServerConfiguration( + zk_conn=self.zk_conn, + ipaddr=self.ip_gateway, + iface=self.bridge_nic, + vni=self.vni, + network=self.ip_network, + router=[self.ip_gateway], + dns_servers=[] + ) + self.dhcp_instance = DHCPServer.DHCPServer(self.vni, dhcp_config) else: self.dhcp_instance.remove() self.dhcp_instance = None - @zk_conn.ChildrenWatch('/networks/{}/dhcp_reservations'.format(self.vni)) - def watch_network_dhcp_reservations(data, event=''): - print(data) - def getvni(self): return self.vni