diff options
Diffstat (limited to 'src/lib/Server/Statistics.py')
-rw-r--r-- | src/lib/Server/Statistics.py | 5 |
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''' |