We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 686b09f commit 24f6516Copy full SHA for 24f6516
hapt/files/hapt.py
@@ -77,8 +77,13 @@ def get_config(config, section):
77
return next(iter(config['values'].values()))
78
79
def get_connected_clients(interface):
80
- response = ubus_call('hostapd.%s' % interface, 'get_clients')
81
- return response['clients'].keys()
+ try:
+ response = ubus_call('hostapd.%s' % interface, 'get_clients')
82
+ return response['clients'].keys()
83
+ except ValueError as e:
84
+ # This can happen if the interface isn't fully up yet, it's fine to continue - we assume nothing is connected
85
+ print("Failed to get connected clients: %s" % e)
86
+ return []
87
88
def connect_hostapd_socket(interface):
89
remote_address = '/var/run/hostapd/%s' % interface
0 commit comments