summaryrefslogtreecommitdiff
path: root/python/vyos/util.py
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2022-04-08 17:50:58 +0300
committerGitHub <noreply@github.com>2022-04-08 17:50:58 +0300
commitbd50d51f1e49724c9a01e9ce5c0aefa04ec3e913 (patch)
tree14ac39549f039921ad67dd02448be2dbeb805a97 /python/vyos/util.py
parent298ce87e8fc444cd42ec10a43a2eb446b71febd6 (diff)
parente5f1df1988a16d683b72a99bbf9c37305131c49e (diff)
downloadvyos-1x-bd50d51f1e49724c9a01e9ce5c0aefa04ec3e913.tar.gz
vyos-1x-bd50d51f1e49724c9a01e9ce5c0aefa04ec3e913.zip
Merge pull request #1263 from c-po/wwan-t4324-equuleus
T4324, T4338, T4339 WWAN interface bugfixes
Diffstat (limited to 'python/vyos/util.py')
-rw-r--r--python/vyos/util.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/python/vyos/util.py b/python/vyos/util.py
index 4283e604c..554614b30 100644
--- a/python/vyos/util.py
+++ b/python/vyos/util.py
@@ -797,6 +797,11 @@ def is_wwan_connected(interface):
if not interface.startswith('wwan'):
raise ValueError(f'Specified interface "{interface}" is not a WWAN interface')
+ # ModemManager is required for connection(s) - if service is not running,
+ # there won't be any connection at all!
+ if not is_systemd_service_active('ModemManager.service'):
+ return False
+
modem = interface.lstrip('wwan')
tmp = cmd(f'mmcli --modem {modem} --output-json')