diff options
-rw-r--r-- | sos/plugins/__init__.py | 6 | ||||
-rw-r--r-- | sos/utilities.py | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py index f53fc94f..03e82f1b 100644 --- a/sos/plugins/__init__.py +++ b/sos/plugins/__init__.py @@ -468,7 +468,8 @@ class Plugin(object): if result['status'] == 124: self._log_warn("command '%s' timed out after %ds" % (prog, timeout)) - if result['status'] == 127: + # 126 means 'found but not executable' + if result['status'] == 126 or result['status'] == 127: self._log_debug("could not run '%s': command not found" % prog) return result @@ -557,7 +558,8 @@ class Plugin(object): """ start = time() result = self.get_command_output(exe, timeout=timeout, runat=runat) - if result['status'] == 127: + # 126 means 'found but not executable' + if result['status'] == 126 or result['status'] == 127: return None self._log_debug("collected output of '%s' in %s" % (exe.split()[0], time() - start)) diff --git a/sos/utilities.py b/sos/utilities.py index 333d7d0c..4dffe695 100644 --- a/sos/utilities.py +++ b/sos/utilities.py @@ -153,7 +153,7 @@ def sos_get_command_output(command, timeout=300, runat=None): # Required hack while we still pass shell=True to Popen; a Popen # call with shell=False for a non-existant binary will raise OSError. - if p.returncode == 127: + if p.returncode == 126 or p.returncode == 127: stdout = six.binary_type(b"") return {'status': p.returncode, 'output': stdout.decode('utf-8')} |