summaryrefslogtreecommitdiffstats
path: root/src/sbin/StatReports
diff options
context:
space:
mode:
authorJoey Hagedorn <hagedorn@mcs.anl.gov>2005-12-20 16:35:36 +0000
committerJoey Hagedorn <hagedorn@mcs.anl.gov>2005-12-20 16:35:36 +0000
commit2e1c0f701ae019f6a2638cc588d2cd24c93b50df (patch)
treea23f13047ccb6d5f627885e0a3d5e56f47442bdd /src/sbin/StatReports
parent61c1165fe8e62677ad5b288a52b61e303df008c4 (diff)
downloadbcfg2-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
Diffstat (limited to 'src/sbin/StatReports')
-rw-r--r--src/sbin/StatReports9
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.")