diff options
author | Thomas Mangin <thomas.mangin@exa.net.uk> | 2020-04-09 19:08:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-09 20:08:24 +0200 |
commit | 9875a21bdb26df19f2faf3e81153dea15e4f9e3c (patch) | |
tree | 8a1ecc1b318d80db156f397c34bc75f40c184728 /src/op_mode/show_acceleration.py | |
parent | c8a86d3ccee63b972c36346e6cb1c712c6801ad2 (diff) | |
download | vyos-1x-9875a21bdb26df19f2faf3e81153dea15e4f9e3c.tar.gz vyos-1x-9875a21bdb26df19f2faf3e81153dea15e4f9e3c.zip |
util: T2226: os.system was wrongly converted to run
os.system does print the ouput of the command, run() does not.
A new function called call() does the printing and return the error code.
Diffstat (limited to 'src/op_mode/show_acceleration.py')
-rwxr-xr-x | src/op_mode/show_acceleration.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/op_mode/show_acceleration.py b/src/op_mode/show_acceleration.py index 05d3d8906..6d44b0f66 100755 --- a/src/op_mode/show_acceleration.py +++ b/src/op_mode/show_acceleration.py @@ -21,7 +21,8 @@ import re import argparse from vyos.config import Config -from vyos.util import popen, run +from vyos.util import popen +from vyos.util import call def detect_qat_dev(): @@ -43,7 +44,7 @@ def show_qat_status(): sys.exit(1) # Show QAT service - run('sudo /etc/init.d/vyos-qat-utilities status') + call('sudo /etc/init.d/vyos-qat-utilities status') # Return QAT devices def get_qat_devices(): @@ -94,20 +95,20 @@ args = parser.parse_args() if args.hw: detect_qat_dev() # Show availible Intel QAT devices - run('sudo lspci -nn | egrep -e \'8086:37c8|8086:19e2|8086:0435|8086:6f54\'') + call('sudo lspci -nn | egrep -e \'8086:37c8|8086:19e2|8086:0435|8086:6f54\'') elif args.flow and args.dev: check_qat_if_conf() - run('sudo cat '+get_qat_proc_path(args.dev)+"fw_counters") + call('sudo cat '+get_qat_proc_path(args.dev)+"fw_counters") elif args.interrupts: check_qat_if_conf() # Delete _dev from args.dev - run('sudo cat /proc/interrupts | grep qat') + call('sudo cat /proc/interrupts | grep qat') elif args.status: check_qat_if_conf() show_qat_status() elif args.conf and args.dev: check_qat_if_conf() - run('sudo cat '+get_qat_proc_path(args.dev)+"dev_cfg") + call('sudo cat '+get_qat_proc_path(args.dev)+"dev_cfg") elif args.dev_list: get_qat_devices() else: |