summaryrefslogtreecommitdiffstats
path: root/rteval
diff options
context:
space:
mode:
authorDavid Sommerseth <davids@redhat.com>2009-09-24 14:56:34 +0200
committerDavid Sommerseth <davids@redhat.com>2009-09-24 15:05:15 +0200
commit470092880d4afc9192f8c73291a32d0809e3833e (patch)
tree732c698dce46201c67400e7b29771ee7ba967430 /rteval
parent3b54905545a114551d66c78c92b55986ba44cc3a (diff)
downloadrteval-470092880d4afc9192f8c73291a32d0809e3833e.tar.gz
rteval-470092880d4afc9192f8c73291a32d0809e3833e.tar.xz
rteval-470092880d4afc9192f8c73291a32d0809e3833e.zip
Moved summary XSLT template file name into the configuration setup
Also send a rtevalCfgSection object of the 'rteval' section to the DMI class, to make the API more unified.
Diffstat (limited to 'rteval')
-rw-r--r--rteval/rteval.py33
1 files changed, 17 insertions, 16 deletions
diff --git a/rteval/rteval.py b/rteval/rteval.py
index 0631a74..432cb61 100644
--- a/rteval/rteval.py
+++ b/rteval/rteval.py
@@ -65,16 +65,17 @@ class RtEval(object):
default_config = {
'rteval': {
- 'verbose' : False,
- 'keepdata' : True,
- 'debugging' : False,
- 'duration' : 60.0,
- 'sysreport' : False,
- 'reportdir' : None,
- 'reportfile': None,
- 'installdir': '/usr/share/rteval',
- 'srcdir' : '/usr/share/rteval/loadsource',
- 'xmlrpc' : None
+ 'verbose' : False,
+ 'keepdata' : True,
+ 'debugging' : False,
+ 'duration' : 60.0,
+ 'sysreport' : False,
+ 'reportdir' : None,
+ 'reportfile' : None,
+ 'installdir' : '/usr/share/rteval',
+ 'srcdir' : '/usr/share/rteval/loadsource',
+ 'xmlrpc' : None,
+ 'xslt_report': '/usr/share/rteval/rteval_text.xsl'
}
}
self.config = rtevalConfig.rtevalConfig(default_config, logfunc=self.info)
@@ -109,9 +110,9 @@ class RtEval(object):
self.get_clocksources()
self.xml = ''
self.xmlreport = xmlout.XMLOut('rteval', self.version)
- self.xslt = os.path.join(self.config.installdir, "rteval_text.xsl")
- if not os.path.exists(self.xslt):
- raise RuntimeError, "can't find XSL template (%s)!" % self.xslt
+
+ if not os.path.exists(self.config.xslt_report):
+ raise RuntimeError, "can't find XSL template (%s)!" % self.config.xslt_report
def get_num_cores(self):
@@ -311,7 +312,7 @@ class RtEval(object):
self.cyclictest.genxml(self.xmlreport)
# now generate the dmidecode data for this host
- d = dmi.DMIinfo(self.config.installdir)
+ d = dmi.DMIinfo(self.config.GetSection('rteval'))
d.genxml(self.xmlreport)
# Close the report - prepare for return the result
@@ -327,13 +328,13 @@ class RtEval(object):
def report(self):
"Create a screen report, based on a predefined XSLT template"
- self.xmlreport.Write("-", self.xslt)
+ self.xmlreport.Write("-", self.config.xslt_report)
def summarize(self, xmlfile):
'''summarize a previously generated xml file'''
print "loading %s for summarizing" % xmlfile
self.xmlreport.LoadReport(xmlfile)
- self.xmlreport.Write('-', self.xslt)
+ self.xmlreport.Write('-', self.config.xslt_report)
def start_loads(self):
if len(self.loads) == 0: