HomeVyOS Platform

T6267: Check interface wireless module before apply config

Description

T6267: Check interface wireless module before apply config

Check if the wireless device/modem exists in the system and the
module ieee802111 was loaded
In cases where we do not have wireless devices, it prevents the
unexpected traceback

set interfaces wireless wlan0 address 192.0.2.5/32
commit

Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/interfaces_wireless.py", line 269, in <modu>
    c = get_config()
        ^^^^^^^^^^^^
  File "/usr/libexec/vyos/conf_mode/interfaces_wireless.py", line 104, in get_cg
    tmp = find_other_stations(conf, base, wifi['ifname'])
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/libexec/vyos/conf_mode/interfaces_wireless.py", line 54, in find_os
    for phy in os.listdir('/sys/class/ieee80211'):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/sys/class/ieee80211'

Details

Provenance
ViacheslavAuthored on Apr 26 2024, 2:50 PM
Parents
rVYOSONEXaa15f74818ca: Merge pull request #3363 from sever-sever/T6263
Branches
Loading...
Tags
Loading...