diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2005-11-29 20:00:54 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2005-11-29 20:00:54 +0000 |
commit | cf87011edb2e2c55e22c3d8732e0ab9e4211c005 (patch) | |
tree | e7d17cc54f0cfeee9fa8f1830d7a508a48f79923 /src/sbin/StatReports | |
parent | d25eb75b8f634e8122245c37a144ad7be9006a5c (diff) | |
download | bcfg2-cf87011edb2e2c55e22c3d8732e0ab9e4211c005.tar.gz bcfg2-cf87011edb2e2c55e22c3d8732e0ab9e4211c005.tar.bz2 bcfg2-cf87011edb2e2c55e22c3d8732e0ab9e4211c005.zip |
fix email (non-xml) formatted reports
(Logical change 1.372)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1569 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/sbin/StatReports')
-rw-r--r-- | src/sbin/StatReports | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/sbin/StatReports b/src/sbin/StatReports index 75409af9a..c0321d23c 100644 --- a/src/sbin/StatReports +++ b/src/sbin/StatReports @@ -263,13 +263,8 @@ if __name__ == '__main__': print("StatReports: Invalid delivery mechanism in report-config") raise SystemExit, 1 - - #IMPORTANT to add some error checking here-parseerrors - #this might be sufficient try: stylesheet = XSLT(parse(transformpath + transform)) - #styledoc = libxml2.parseFile(transformpath+transform) - #style = libxslt.parseStylesheetDoc(styledoc) except: print("StatReports: invalid XSLT transform file.") raise SystemExit, 1 @@ -281,8 +276,10 @@ if __name__ == '__main__': [reportdata.remove(y) for y in reportdata.findall("Node")] reportdata.append(noden) else: - reportdata = procnodereport - outputstring = tostring(stylesheet.apply(reportdata).getroot()) + reportdata = deepcopy(procnodereport) + + result = stylesheet.apply(ElementTree(reportdata)) + outputstring = stylesheet.tostring(result) if not outputstring == None: toastring = '' |