Author: gnichols
Date: 2010-01-29 14:57:37 +0000 (Fri, 29 Jan 2010)
New Revision: 352
Modified:
trunk/v7/commandLineUI.py
trunk/v7/controller.py
Log:
192245 - info test should call sosreport instead of sysreport
Modified: trunk/v7/commandLineUI.py
===================================================================
--- trunk/v7/commandLineUI.py 2010-01-29 14:56:23 UTC (rev 351)
+++ trunk/v7/commandLineUI.py 2010-01-29 14:57:37 UTC (rev 352)
@@ -13,7 +13,7 @@
#
# Author: Greg Nichols
#
-import string, os, sys, copy
+import string, os, sys, copy, re
from v7.tags import Constants
@@ -68,4 +68,17 @@
def promptContinue(self, message):
return self.promptConfirm(question=("%s - continue? " % message))
+
+ def getRedHatRelease(self):
+ f=open("/etc/redhat-release")
+ line=f.readline()
+ f.close()
+ if line:
+ pattern = re.compile("^(?P<product>[a-zA-Z\ ]+)release
(?P<number>[1-9\.]+) \((?P<name>[a-zA-Z0-9\ ]+)\)")
+ match = pattern.match(line)
+ product = None
+ if match.group("product"):
+ product = match.group("product").strip()
+ return (product, match.group("number"),
match.group("name"))
+ return (None, None, None)
Modified: trunk/v7/controller.py
===================================================================
--- trunk/v7/controller.py 2010-01-29 14:56:23 UTC (rev 351)
+++ trunk/v7/controller.py 2010-01-29 14:57:37 UTC (rev 352)
@@ -91,4 +91,5 @@
print "Error: Could not find log messages in %s!" % syslog
return contents
-
+ def getRedHatRelease(self):
+ return self.ui.getRedHatRelease()