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. --- src/conf_mode/interfaces_wwan.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/conf_mode/interfaces_wwan.py b/src/conf_mode/interfaces_wwan.py index 166b857a8..ad6c806ad 100755 --- a/src/conf_mode/interfaces_wwan.py +++ b/src/conf_mode/interfaces_wwan.py @@ -149,9 +149,15 @@ def apply(wwan): modem = wwan['ifname'].lstrip('wwan') base_cmd = f'mmcli --modem {modem}' # Number of bearers is limited - always disconnect first - cmd(f'{base_cmd} --simple-disconnect') + call(f'{base_cmd} --simple-disconnect') w = WWANIf(wwan['ifname']) + + # We cannot proceed with the configuration if the modem is not detected - so we bail out + # and wait for the next cronjob run to re-apply the configuration. + if not w.exists(wwan['ifname']): + return None + if 'deleted' in wwan or 'disable' in wwan: w.remove() -- cgit v1.2.3