diff options
author | Joey Hagedorn <hagedorn@mcs.anl.gov> | 2005-12-20 16:35:36 +0000 |
---|---|---|
committer | Joey Hagedorn <hagedorn@mcs.anl.gov> | 2005-12-20 16:35:36 +0000 |
commit | 2e1c0f701ae019f6a2638cc588d2cd24c93b50df (patch) | |
tree | a23f13047ccb6d5f627885e0a3d5e56f47442bdd | |
parent | 61c1165fe8e62677ad5b288a52b61e303df008c4 (diff) | |
download | bcfg2-2e1c0f701ae019f6a2638cc588d2cd24c93b50df.tar.gz bcfg2-2e1c0f701ae019f6a2638cc588d2cd24c93b50df.tar.bz2 bcfg2-2e1c0f701ae019f6a2638cc588d2cd24c93b50df.zip |
Minor code cleanups
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1633 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r-- | src/sbin/StatReports | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/sbin/StatReports b/src/sbin/StatReports index fd26d703f..ef6a8df66 100644 --- a/src/sbin/StatReports +++ b/src/sbin/StatReports @@ -236,18 +236,19 @@ if __name__ == '__main__': deliverymechanism = deliv.get('mechanism', default='www') #apply XSLT, different ones based on report type, and options - if deliverymechanism == 'null-operator': - fileout(tostring(ElementTree(procnodereport).getroot()),deliv) + if deliverymechanism == 'null-operator': #Special Cases + fileout(tostring(ElementTree(procnodereport).getroot()), deliv) break transform = delivtype + '-' + deliverymechanism + '.xsl' - try: + + try: #make sure valid stylesheet is selected os.stat(transformpath + transform) except: print("StatReports: Invalid report type or delivery mechanism.\n Can't find: "\ + transformpath + transform) raise SystemExit, 1 - try: + try: #try to parse stylesheet stylesheet = XSLT(parse(transformpath + transform)) except: print("StatReports: invalid XSLT transform file.") |