From 07c3bb021d77164ef5f7a4e02b869ea4c11da971 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 1 Apr 2022 22:30:53 +0200 Subject: wwan: T4324: is_wwan_connected() must verify if ModemManager is running (cherry picked from commit 15c94a8706622927850eba8c22fcff2df32978b4) --- python/vyos/util.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'python/vyos') diff --git a/python/vyos/util.py b/python/vyos/util.py index b5d81fba5..fb405166e 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') -- cgit v1.2.3