summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-09-06 08:23:24 +0200
committerChristian Poessinger <christian@poessinger.com>2021-09-06 08:24:01 +0200
commitc14bb9ab38112837c3e1e0cafcb3b8f19cfba1c0 (patch)
tree34d1064bc4b1e8cb654c2a734ebca4ca0ed13ef4
parent83c064de8870262f848151faea30991a49a619d4 (diff)
downloadvyos-1x-c14bb9ab38112837c3e1e0cafcb3b8f19cfba1c0.tar.gz
vyos-1x-c14bb9ab38112837c3e1e0cafcb3b8f19cfba1c0.zip
wwan: T3620: op-mode: not all commands supported by all modems - add info message
(cherry picked from commit 10814c4d3360598262e991e4b20768dfcde91d75)
-rw-r--r--op-mode-definitions/show-interfaces-wwan.xml.in4
-rwxr-xr-xsrc/op_mode/show_wwan.py18
2 files changed, 13 insertions, 9 deletions
diff --git a/op-mode-definitions/show-interfaces-wwan.xml.in b/op-mode-definitions/show-interfaces-wwan.xml.in
index d57e17a13..7e5f49ba6 100644
--- a/op-mode-definitions/show-interfaces-wwan.xml.in
+++ b/op-mode-definitions/show-interfaces-wwan.xml.in
@@ -68,9 +68,9 @@
</properties>
<command>sudo ${vyos_op_scripts_dir}/show_wwan.py --interface=$4 --sim</command>
</leafNode>
- <leafNode name="summary">
+ <leafNode name="detail">
<properties>
- <help>Show WWAN module information summary</help>
+ <help>Show WWAN module detailed information summary</help>
</properties>
<command>mmcli --modem ${4#wwan}</command>
</leafNode>
diff --git a/src/op_mode/show_wwan.py b/src/op_mode/show_wwan.py
index 249dda2a5..529b5bd0f 100755
--- a/src/op_mode/show_wwan.py
+++ b/src/op_mode/show_wwan.py
@@ -34,13 +34,17 @@ required = parser.add_argument_group('Required arguments')
required.add_argument("--interface", help="WWAN interface name, e.g. wwan0", required=True)
def qmi_cmd(device, command, silent=False):
- tmp = cmd(f'qmicli --device={device} --device-open-proxy {command}')
- tmp = tmp.replace(f'[{cdc}] ', '')
- if not silent:
- # skip first line as this only holds the info headline
- for line in tmp.splitlines()[1:]:
- print(line.lstrip())
- return tmp
+ try:
+ tmp = cmd(f'qmicli --device={device} --device-open-proxy {command}')
+ tmp = tmp.replace(f'[{cdc}] ', '')
+ if not silent:
+ # skip first line as this only holds the info headline
+ for line in tmp.splitlines()[1:]:
+ print(line.lstrip())
+ return tmp
+ except:
+ print('Command not supported by Modem')
+ exit(1)
if __name__ == '__main__':
args = parser.parse_args()