diff options
author | Pavel Moravec <pmoravec@redhat.com> | 2019-03-21 09:48:20 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2019-03-21 09:59:49 +0000 |
commit | 4e7b89f54648ece299a15ffcd07a62ce19457052 (patch) | |
tree | e4a37c7ac2557fae48731b3278c90e98af53ea1a | |
parent | 96c383e7c5da3e4bac3955d872e3ad1b700c6131 (diff) | |
download | sos-4e7b89f54648ece299a15ffcd07a62ce19457052.tar.gz |
[python] check dist_version only on RHELPolicy
Call /usr/libexec/platform-python only on RHEL (of version bigger
than 7).
Resolves: #1605
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r-- | sos/plugins/python.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sos/plugins/python.py b/sos/plugins/python.py index 003fd308..dc719fba 100644 --- a/sos/plugins/python.py +++ b/sos/plugins/python.py @@ -9,6 +9,7 @@ # See the LICENSE file in the source distribution for further information. from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin +import sos.policies class Python(Plugin, DebianPlugin, UbuntuPlugin): @@ -30,7 +31,8 @@ class RedHatPython(Python, RedHatPlugin): def setup(self): self.add_cmd_output(['python2 -V', 'python3 -V']) - if self.policy.dist_version() > 7: + if isinstance(self.policy, sos.policies.redhat.RHELPolicy) and \ + self.policy.dist_version() > 7: self.add_cmd_output( '/usr/libexec/platform-python -V', suggest_filename='python-version' |