aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2011-02-03 09:05:00 +0000
committerBryn M. Reeves <bmr@redhat.com>2011-02-03 09:05:00 +0000
commitdf02b541c97d944bf8262d68784459591fe70c22 (patch)
treee4dc77314cac84c8c5d03498d3cc4d8d70a3dc19
parent2b80b56737b4885e03cbdf2e8299d2cb04aa9491 (diff)
downloadsos-df02b541c97d944bf8262d68784459591fe70c22.tar.gz
Correct handling of redhat-release for el6
-rwxr-xr-xsos/policyredhat.py6
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