summaryrefslogtreecommitdiff
path: root/src/op_mode/show_acceleration.py
diff options
context:
space:
mode:
authorThomas Mangin <thomas.mangin@exa.net.uk>2020-04-05 14:36:29 +0100
committerThomas Mangin <thomas.mangin@exa.net.uk>2020-04-06 20:22:35 +0100
commitaceb0817a65bf01669cada3ceb60d65b81607bc3 (patch)
tree5418d4537cfc14115536315909fbb7a83277fe7a /src/op_mode/show_acceleration.py
parent356950579c2b155f9d41c04ed63c7efde561b43a (diff)
downloadvyos-1x-aceb0817a65bf01669cada3ceb60d65b81607bc3.tar.gz
vyos-1x-aceb0817a65bf01669cada3ceb60d65b81607bc3.zip
util: T2226: covert most calls from os.system to util
As little change a possible but the function call The behaviour should be totally unchanged.
Diffstat (limited to 'src/op_mode/show_acceleration.py')
-rwxr-xr-xsrc/op_mode/show_acceleration.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/op_mode/show_acceleration.py b/src/op_mode/show_acceleration.py
index 3ba0e85dd..cdd8ce037 100755
--- a/src/op_mode/show_acceleration.py
+++ b/src/op_mode/show_acceleration.py
@@ -21,6 +21,8 @@ import re
import argparse
import subprocess
from vyos.config import Config
+from vyos.util import popen, run
+
def detect_qat_dev():
ret = subprocess.Popen(['sudo', 'lspci', '-nn'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
@@ -97,20 +99,20 @@ args = parser.parse_args()
if args.hw:
detect_qat_dev()
# Show availible Intel QAT devices
- os.system('sudo lspci -nn | egrep -e \'8086:37c8|8086:19e2|8086:0435|8086:6f54\'')
+ run('sudo lspci -nn | egrep -e \'8086:37c8|8086:19e2|8086:0435|8086:6f54\'')
elif args.flow and args.dev:
check_qat_if_conf()
- os.system('sudo cat '+get_qat_proc_path(args.dev)+"fw_counters")
+ run('sudo cat '+get_qat_proc_path(args.dev)+"fw_counters")
elif args.interrupts:
check_qat_if_conf()
# Delete _dev from args.dev
- os.system('sudo cat /proc/interrupts | grep qat')
+ run('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()
- os.system('sudo cat '+get_qat_proc_path(args.dev)+"dev_cfg")
+ run('sudo cat '+get_qat_proc_path(args.dev)+"dev_cfg")
elif args.dev_list:
get_qat_devices()
else: