summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2026-05-25 18:04:46 +0300
committerGitHub <noreply@github.com>2026-05-25 18:04:46 +0300
commit85872cc0de6ef92d3e36f328c0e9a357ddfbb605 (patch)
tree6fdc12eb619911258c881324cf5093323829d8ee /src
parentdc47f550e908eb4252ab2a30791b851403a3feae (diff)
parent8a537e8097ac80c696299d267e1dd1c9b6000bab (diff)
downloadvyos-1x-85872cc0de6ef92d3e36f328c0e9a357ddfbb605.tar.gz
vyos-1x-85872cc0de6ef92d3e36f328c0e9a357ddfbb605.zip
Merge pull request #5216 from natali-rs1985/T8412
wwan: T8412: Fix commit failure when modem is absent or not connected
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/interfaces_wwan.py8
1 files changed, 7 insertions, 1 deletions
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()