Merge ~sylvain-pineau/plainbox-provider-resource:fix-1863725 into plainbox-provider-resource:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: c5de7490b7782d20b8ce16e277c407da201895ae
Merged at revision: f6501cef628899ce59ad8b5001c8e76e443936ac
Proposed branch: ~sylvain-pineau/plainbox-provider-resource:fix-1863725
Merge into: plainbox-provider-resource:master
Diff against target: 37 lines (+2/-12)
1 file modified
bin/mobilebroadband_resource (+2/-12)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+379452@code.launchpad.net

Description of the change

Fixes the linked bug

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

Tested on the lab system prepared by Gene

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/mobilebroadband_resource b/bin/mobilebroadband_resource
2index 6b7e347..10e9adc 100755
3--- a/bin/mobilebroadband_resource
4+++ b/bin/mobilebroadband_resource
5@@ -2,7 +2,7 @@
6 #
7 # This file is part of Checkbox.
8 #
9-# Copyright 2014 Canonical Ltd.
10+# Copyright 2014-2020 Canonical Ltd.
11 #
12 # Checkbox is free software: you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License version 3,
14@@ -22,7 +22,7 @@ MMCLI_PATH=$(which mmcli)
15
16 if [ -x "$MMCLI_PATH" ]; then
17 # Use mmcli to query for modem capabilities
18- for i in $(mmcli --simple-status -L | \
19+ for i in $(mmcli --simple-status -L 2>/dev/null || mmcli -L | \
20 awk '/freedesktop\/ModemManager1\/Modem/ {print $1;}'); do
21 mmcli -m $i |grep -q "supported: .*gsm-umts.*" && GSM=yes
22 mmcli -m $i |grep -q "supported: .*cdma.*" && CDMA=yes
23@@ -32,15 +32,5 @@ if [ -x "$MMCLI_PATH" ]; then
24 # really failed :D
25 [ "$GSM" = "yes" ] && echo "gsm: supported" || true
26 [ "$CDMA" = "yes" ] && echo "cdma: supported" || true
27-else
28- # Fall back to old mm-test script
29- if mm-test --no-scan | grep -q 'GSM modem'
30- then
31- echo "gsm: supported"
32- fi
33- if mm-test --no-scan | grep -q 'CDMA modem'
34- then
35- echo "cdma: supported"
36- fi
37 fi
38

Subscribers

People subscribed via source and target branches