diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-09-06 08:23:24 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-09-06 08:23:24 +0200 |
commit | 10814c4d3360598262e991e4b20768dfcde91d75 (patch) | |
tree | 31397a9ae0b3d33d7dbbda1879b06a60ce8c1936 /src/op_mode/show_wwan.py | |
parent | 0a82936aff8bbfcc6253f4767ea82805525c47ec (diff) | |
download | vyos-1x-10814c4d3360598262e991e4b20768dfcde91d75.tar.gz vyos-1x-10814c4d3360598262e991e4b20768dfcde91d75.zip |
wwan: T3620: op-mode: not all commands supported by all modems - add info message
Diffstat (limited to 'src/op_mode/show_wwan.py')
-rwxr-xr-x | src/op_mode/show_wwan.py | 18 |
1 files changed, 11 insertions, 7 deletions
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() |