From 7ac896b241cfe89ef0972ae9dd171718c9050db3 Mon Sep 17 00:00:00 2001 From: Adam Glasgall Date: Sun, 28 Apr 2013 15:10:46 -0400 Subject: [PATCH] pydhcplib api breakage --- debian/changelog | 7 +++++++ invirt-dhcpserver | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3cb13d2..30d7788 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +invirt-dhcp (0.0.6~glasgall3) precise; urgency=low + + * pydhcplib api breakage! server_identifier now has to be a "32-bits" + instead of an "ipv4"; adjust types accordingly. + + -- Adam Glasgall Sun, 28 Apr 2013 15:10:04 -0400 + invirt-dhcp (0.0.6~glasgall2) precise; urgency=low * pydhcpserver expects IP address strings to be strs. encode the diff --git a/invirt-dhcpserver b/invirt-dhcpserver index c017447..1f57a8d 100755 --- a/invirt-dhcpserver +++ b/invirt-dhcpserver @@ -97,7 +97,7 @@ class DhcpBackend: nic = self.findNIC(str(chaddr)) if nic is None or nic.machine is None: return False - ip = nic.ip + ip = nic.ip.encode("utf-8") if ip is None: #Deactivated? return False @@ -114,7 +114,7 @@ class DhcpBackend: del options['domain_name'] options['domain_search'] = [config.dhcp.search_domain] if ip is not None: - ip = ipv4(ip.encode("utf-8")) + ip = ipv4(ip) s.syslog(s.LOG_DEBUG,"dhcp_backend : Discover result = "+str(ip)) packet_parameters = self.getParameters(**options) @@ -262,7 +262,7 @@ if '__main__' == __name__: print "invirt-dhcpserver: cannot determine local IP address by looking up %s" % socket.gethostname() sys.exit(1) - dhcp_options['server_identifier'] = myip + dhcp_options['server_identifier'] = ipv4(myip) backend = DhcpBackend() server = DhcpServer(backend, options) -- 1.7.9.5