~annegentle/nova/extdoc

« back to all changes in this revision

Viewing changes to nova/log.py

  • Committer: vladimir.p
  • Date: 2011-08-26 02:18:46 UTC
  • mfrom: (1499 nova)
  • mto: This revision was merged to the branch mainline in revision 1502.
  • Revision ID: vladimir@zadarastorage.com-20110826021846-rrqtmv3ynu3bhg3n
merged with rev.1499

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
import logging
33
33
import logging.handlers
34
34
import os
 
35
import stat
35
36
import sys
36
37
import traceback
37
38
 
257
258
                self.filelog = WatchedFileHandler(logpath)
258
259
                self.addHandler(self.filelog)
259
260
                self.logpath = logpath
260
 
                os.chmod(self.logpath, FLAGS.logfile_mode)
 
261
 
 
262
                st = os.stat(self.logpath)
 
263
                if st.st_mode != (stat.S_IFREG | FLAGS.logfile_mode):
 
264
                    os.chmod(self.logpath, FLAGS.logfile_mode)
261
265
        else:
262
266
            self.removeHandler(self.filelog)
263
267
            self.addHandler(self.streamlog)