diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2011-02-03 09:05:00 +0000 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2011-02-03 09:05:00 +0000 |
commit | df02b541c97d944bf8262d68784459591fe70c22 (patch) | |
tree | e4dc77314cac84c8c5d03498d3cc4d8d70a3dc19 | |
parent | 2b80b56737b4885e03cbdf2e8299d2cb04aa9491 (diff) | |
download | sos-df02b541c97d944bf8262d68784459591fe70c22.tar.gz |
Correct handling of redhat-release for el6
-rwxr-xr-x | sos/policyredhat.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sos/policyredhat.py b/sos/policyredhat.py index c6bdddfb..863445ae 100755 --- a/sos/policyredhat.py +++ b/sos/policyredhat.py @@ -153,12 +153,14 @@ class SosPolicy: def rhelVersion(self): try: - pkgname = self.pkgByName("redhat-release")["version"] + pkg = self.pkgByName("redhat-release") or \ + self.allPkgsByNameRegex("redhat-release-.*")[-1] + pkgname = pkg["version"] if pkgname[0] == "4": return 4 elif pkgname in [ "5Server", "5Client" ]: return 5 - elif pkgname == "6": + elif pkgname[0] == "6": return 6 except: pass return False |