mirror of
https://github.com/gryf/wicd.git
synced 2026-01-07 06:14:16 +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:
|
else:
|
||||||
# Run dhcp...
|
# Run dhcp...
|
||||||
self.SetStatus('running_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"]
|
print "Running DHCP with hostname",self.network["dhcphostname"]
|
||||||
dhcp_status = iface.StartDHCP(self.network["dhcphostname"])
|
dhcp_status = iface.StartDHCP(self.network["dhcphostname"])
|
||||||
if dhcp_status in ['no_dhcp_offers', 'dhcp_failed']:
|
if dhcp_status in ['no_dhcp_offers', 'dhcp_failed']:
|
||||||
|
|||||||
@@ -328,6 +328,8 @@ class BaseInterface(object):
|
|||||||
return ""
|
return ""
|
||||||
|
|
||||||
if flavor == "connect":
|
if flavor == "connect":
|
||||||
|
if not hostname:
|
||||||
|
hostname = os.uname()[1]
|
||||||
return client_dict[client_name]['connect'] % \
|
return client_dict[client_name]['connect'] % \
|
||||||
{ "cmd" : cmd,
|
{ "cmd" : cmd,
|
||||||
"iface" : self.iface,
|
"iface" : self.iface,
|
||||||
|
|||||||
Reference in New Issue
Block a user