From 77eb4abc7cbd9d830afdaf77763bea2ace2ea0d4 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Tue, 28 Mar 2017 17:15:28 +0100 Subject: [Plugin] do not return output from failed commands If a command returns status of '1' in Plugin.get_cmd_output_now(), do not return output even if the command wrote to stdio. Signed-off-by: Bryn M. Reeves --- sos/plugins/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py index 4eca81cb..46f9cb83 100644 --- a/sos/plugins/__init__.py +++ b/sos/plugins/__init__.py @@ -687,6 +687,10 @@ class Plugin(object): # 126 means 'found but not executable' if result['status'] == 126 or result['status'] == 127: return None + + if result['status'] == 1: + return None + self._log_debug("collected output of '%s' in %s" % (exe.split()[0], time() - start)) -- cgit