summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-06-10 14:02:19 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-06-10 14:02:19 +0000
commita56114f22e093d61e7b9948cee858069cefcbf7a (patch)
tree10c5a2b32faf9026674c429eb3b8fc62d500e965 /src
parent7fb3fc58674e5ff7fd1310c4839df5ca0004f8db (diff)
downloadbcfg2-a56114f22e093d61e7b9948cee858069cefcbf7a.tar.gz
bcfg2-a56114f22e093d61e7b9948cee858069cefcbf7a.tar.bz2
bcfg2-a56114f22e093d61e7b9948cee858069cefcbf7a.zip
Patch from Jos for statistics error handling
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1875 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Statistics.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/Server/Statistics.py b/src/lib/Server/Statistics.py
index e13bd805e..555afe052 100644
--- a/src/lib/Server/Statistics.py
+++ b/src/lib/Server/Statistics.py
@@ -41,12 +41,13 @@ class Statistics(object):
#syslog(LOG_INFO, "Statistics: Updated statistics.xml")
try:
fout = open(self.filename, 'w')
+ except IOError, ioerr:
+ self.logger.error("Failed to open %s for writing: %s" % (self.filename, ioerr))
+ else:
fout.write(self.pretty_print(self.element))
fout.close()
self.dirty = 0
self.lastwrite = time()
- except IOError:
- self.logger.error("Failed to open %s for writing" % (self.filename))
def ReadFromFile(self):
'''Reads current state regarding statistics'''