1
0
mirror of https://github.com/gryf/wicd.git synced 2026-01-06 13:54:17 +01:00

Make dhcp hostnames optional, and modify wicd-curses to support this.

If the no hostname is to be used, then we give dhcp the system hostname instead.
This commit is contained in:
Andrew Psaltis
2009-11-26 00:45:59 -05:00
parent 9d4e73b3c6
commit 2159666240
2 changed files with 23 additions and 7 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)