diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-09-30 06:18:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-30 06:18:19 +0200 |
| commit | 8df929883bbffeb6b1dc8cb4dd0d8e8f6c328341 (patch) | |
| tree | 9bdfa516ff68dc4af9f4e040b4cb06a8dad33f9d /src | |
| parent | 98e4432163032c894ef10b7f14522471c2a54530 (diff) | |
| parent | 1aa2cd1df614925cf68964239eeaaf42ea74bc43 (diff) | |
| download | vyos-1x-8df929883bbffeb6b1dc8cb4dd0d8e8f6c328341.tar.gz vyos-1x-8df929883bbffeb6b1dc8cb4dd0d8e8f6c328341.zip | |
Merge pull request #5483 from yzguy/wwan-modem-by-port-ownership
wwan: T7487: identify modem by port ownership, not interface number
Diffstat (limited to 'src')
| -rwxr-xr-x | src/op_mode/show_wwan.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/op_mode/show_wwan.py b/src/op_mode/show_wwan.py index c9371f410..2215b499e 100755 --- a/src/op_mode/show_wwan.py +++ b/src/op_mode/show_wwan.py @@ -68,7 +68,10 @@ def mmcli(*args: str) -> dict: def modem_info(ifname: str) -> dict: """ Return everything ModemManager knows about the modem behind ifname """ - return mmcli('--modem', modem_index(ifname))['modem'] + index = modem_index(ifname) + if index is None: + raise ValueError(f'No modem found for interface "{ifname}"') + return mmcli('--modem', index)['modem'] def sim_info(modem: dict) -> dict: """ Return the properties of the SIM card inserted into a modem """ |
