Ensure non-default FLAGS.logfile_mode is properly converted to an octet.
Fixes bug 862969. Change-Id: I35ac84d5f5f547fef8e3eec1d3a31f94ea8ae96e
This commit is contained in:
@@ -259,9 +259,10 @@ class NovaRootLogger(NovaLogger):
|
||||
self.addHandler(self.filelog)
|
||||
self.logpath = logpath
|
||||
|
||||
mode = int(FLAGS.logfile_mode, 8)
|
||||
st = os.stat(self.logpath)
|
||||
if st.st_mode != (stat.S_IFREG | FLAGS.logfile_mode):
|
||||
os.chmod(self.logpath, FLAGS.logfile_mode)
|
||||
if st.st_mode != (stat.S_IFREG | mode):
|
||||
os.chmod(self.logpath, mode)
|
||||
else:
|
||||
self.removeHandler(self.filelog)
|
||||
self.addHandler(self.streamlog)
|
||||
|
||||
Reference in New Issue
Block a user