summaryrefslogtreecommitdiff
path: root/python
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 /python
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 'python')
-rw-r--r--python/vyos/ifconfig/wwan.py4
-rw-r--r--python/vyos/utils/network.py6
2 files changed, 9 insertions, 1 deletions
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