Skip to content

Commit e6c57fc

Browse files
committed
ui: don't spam logs when NetworkManager is not available
_get_adapter treats the reply body as a list of device paths without checking whether the reply is a D-Bus error. Without NetworkManager on the bus the body is an error string, so it iterates the string, throws on the first character, and the retry loop in _wait_for_wifi_device logs a traceback every second.
1 parent 4b6922b commit e6c57fc

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

openpilot/system/ui/lib/wifi_manager.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,11 @@ def _wait_for_wifi_device(self):
515515
def _get_adapter(self, adapter_type: int) -> str | None:
516516
# Return the first NetworkManager device path matching adapter_type
517517
try:
518-
device_paths = self._router_main.send_and_get_reply(new_method_call(self._nm, 'GetDevices')).body[0]
519-
for device_path in device_paths:
518+
reply = self._router_main.send_and_get_reply(new_method_call(self._nm, 'GetDevices'))
519+
if reply.header.message_type == MessageType.error:
520+
# NetworkManager is not available, body holds an error string instead of device paths
521+
return None
522+
for device_path in reply.body[0]:
520523
dev_addr = DBusAddress(device_path, bus_name=NM, interface=NM_DEVICE_IFACE)
521524
dev_type = self._router_main.send_and_get_reply(Properties(dev_addr).get('DeviceType')).body[0][1]
522525
if dev_type == adapter_type:

0 commit comments

Comments
 (0)