1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-24 23:22:27 +01:00

Fix annoying KeyError bug if no prior dhcp hostname has been set.

This commit is contained in:
Andrew Psaltis
2009-11-26 00:01:07 -05:00
parent c51f2b423f
commit f7d39b249d
2 changed files with 4 additions and 0 deletions

View File

@@ -448,6 +448,8 @@ class ConnectThread(threading.Thread):
else:
# Run dhcp...
self.SetStatus('running_dhcp')
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 dhcp_status in ['no_dhcp_offers', 'dhcp_failed']:

View File

@@ -328,6 +328,8 @@ class BaseInterface(object):
return ""
if flavor == "connect":
if not hostname:
hostname = os.uname()[1]
return client_dict[client_name]['connect'] % \
{ "cmd" : cmd,
"iface" : self.iface,