From 8a537e8097ac80c696299d267e1dd1c9b6000bab Mon Sep 17 00:00:00 2001 From: Nataliia Solomko Date: Fri, 22 May 2026 16:54:27 +0300 Subject: wwan: T8412: Fix commit failure when modem is absent or not connected `mmcli --simple-disconnect` can be called when the modem bearer is not active. This causes cmd() to raise a `PermissionError` and abort the commit. Handle the case gracefully so the configuration can be committed before the modem is physically present or fully connected. --- python/vyos/ifconfig/wwan.py | 4 ++++ python/vyos/utils/network.py | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'python') diff --git a/python/vyos/ifconfig/wwan.py b/python/vyos/ifconfig/wwan.py index 2b5714b85..ffd3d0a67 100644 --- a/python/vyos/ifconfig/wwan.py +++ b/python/vyos/ifconfig/wwan.py @@ -26,6 +26,10 @@ class WWANIf(Interface): }, } + def _create(self): + # we can not create this interface as it is managed by the Kernel + pass + def remove(self): """ Remove interface from config. Removing the interface deconfigures all diff --git a/python/vyos/utils/network.py b/python/vyos/utils/network.py index f20450a5f..8985224f3 100644 --- a/python/vyos/utils/network.py +++ b/python/vyos/utils/network.py @@ -238,7 +238,11 @@ def is_wwan_connected(interface): modem = interface.lstrip('wwan') - tmp = cmd(f'mmcli --modem {modem} --output-json') + try: + tmp = cmd(f'mmcli --modem {modem} --output-json') + except OSError: + return False + tmp = loads(tmp) # return True/False if interface is in connected state -- cgit v1.2.3