1
0
mirror of https://github.com/gryf/wicd.git synced 2026-01-04 21:04:15 +01:00

merged optional-dhcp-hostnames to make optional hostnames work in the daemon

This commit is contained in:
Adam Blackburn
2009-11-26 21:43:15 -06:00
2 changed files with 24 additions and 8 deletions

View File

@@ -448,10 +448,16 @@ class ConnectThread(threading.Thread):
else:
# Run dhcp...
self.SetStatus('running_dhcp')
if self.network.get('usedhcphostname') == None:
self.network['usedhcphostname'] = False
if self.network.get('dhcphostname') == None:
self.network['dhcphostname'] = os.uname()[1]
print "Running DHCP with hostname",self.network["dhcphostname"]
dhcp_status = iface.StartDHCP(self.network["dhcphostname"])
if not self.network['usedhcphostname']:
hname = os.uname()[1]
else:
hname = self.network['dhcphostname']
print "Running DHCP with hostname",hname
dhcp_status = iface.StartDHCP(hname)
if dhcp_status in ['no_dhcp_offers', 'dhcp_failed']:
if self.connect_result != "aborted":
self.abort_connection(dhcp_status)