From: Eric Price Date: Tue, 11 Dec 2007 07:23:21 +0000 (-0500) Subject: Allow fully qualified domains in the NICs table to override the X-Git-Tag: sipb-xen-dhcp/1~6 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-dhcp.git/commitdiff_plain/5b5216809d7e7d0e78df31d274c2e97eb77be2c2 Allow fully qualified domains in the NICs table to override the name.servers.csail.mit.edu domains. svn path=/trunk/dhcp/; revision=252 --- diff --git a/dhcpserver.py b/dhcpserver.py index 8f4a129..3133643 100644 --- a/dhcpserver.py +++ b/dhcpserver.py @@ -109,9 +109,12 @@ class DhcpBackend: ip = nic.ip if ip is None: #Deactivated? return False - hostname = nic.machine.name - if hostname is not None: - hostname += ".servers.csail.mit.edu" + if nic.hostname and '.' in nic.hostname: + hostname = nic.hostname + elif nic.machine.name: + hostname = nic.machine.name + '.servers.csail.mit.edu' + else: + hostname = None if ip is not None: ip = ipv4(ip) Log.Output(Log.debug,"dhcp_backend : Discover result = "+str(ip))