From cb1c3ff4f76f045fdc45076e92f26b610b5ded94 Mon Sep 17 00:00:00 2001 From: Dmitry Bogun Date: Mon, 12 Dec 2016 13:51:20 +0200 Subject: [PATCH] Replace pidof call Replace OS specific "pidof" call on more common and mostly equivalent "ps" call. It allows to use framework not only on RedHat based OS. Change-Id: I4ac1c145e30d7f2b43fcb371e819f9943eab91f1 --- ramdisk_func_test/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ramdisk_func_test/utils.py b/ramdisk_func_test/utils.py index a7cd69a..27cf17a 100644 --- a/ramdisk_func_test/utils.py +++ b/ramdisk_func_test/utils.py @@ -123,4 +123,6 @@ def read_config(path): def _pid_of(name): - return check_output(["pidof", name]).rstrip() + cmd = ['ps', '-o', 'pid=', '-C', name] + pidset = check_output(cmd).rstrip() + return [(int(x) for x in pidset.splitlines())]