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:
@@ -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']:
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user