Module: check_mk
Branch: master
Commit: b22b79da63deec05903b4dd0fcf6b69f6647218c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b22b79da63deec…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Dec 20 08:12:07 2017 +0100
AC tests: Minor subprocess call cleanup
Change-Id: Ibbdb608f1c589d71af00eab1fa2229f9209ce582
---
web/plugins/wato/ac_tests.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/web/plugins/wato/ac_tests.py b/web/plugins/wato/ac_tests.py
index 9bd8cc1..ba7779a 100644
--- a/web/plugins/wato/ac_tests.py
+++ b/web/plugins/wato/ac_tests.py
@@ -399,8 +399,8 @@ class ACTestApacheNumberOfProcesses(ACTest, BPApacheTest):
raise MKGeneralException(_("Failed to read the apache process
ID"))
sizes = []
- for pid in os.popen("ps --ppid %s h o pid" % ppid):
- summary_line = os.popen("pmap -d %d" % int(pid)).readlines()[-1]
+ for pid in subprocess.check_output(["ps", "--ppid",
"%d" % ppid, "h", "o", "pid"]).splitlines():
+ summary_line = subprocess.check_output(["pmap", "-d",
"%d" % int(pid)]).splitlines()[-1]
sizes.append(int(summary_line.split()[3][:-1])*1024.0)
if not sizes: