summaryrefslogtreecommitdiffstats
path: root/nova/log.py
diff options
context:
space:
mode:
authorAdam Gandelman <adamg@canonical.com>2011-09-29 21:06:06 -0700
committerAdam Gandelman <adamg@canonical.com>2011-09-29 21:06:06 -0700
commit5b173ef5dfb7c41dbc2a4bb5c9976811516eb00f (patch)
tree96f47cc2c715ef5cab7ee81ca3d387a9baf7bdce /nova/log.py
parenteb4bd86f65a440b39804d16e477aeb77f31e11c1 (diff)
downloadnova-5b173ef5dfb7c41dbc2a4bb5c9976811516eb00f.tar.gz
nova-5b173ef5dfb7c41dbc2a4bb5c9976811516eb00f.tar.xz
nova-5b173ef5dfb7c41dbc2a4bb5c9976811516eb00f.zip
Ensure non-default FLAGS.logfile_mode is properly converted to an octet.
Fixes bug 862969. Change-Id: I35ac84d5f5f547fef8e3eec1d3a31f94ea8ae96e
Diffstat (limited to 'nova/log.py')
-rw-r--r--nova/log.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/nova/log.py b/nova/log.py
index eb0b6020f..1e04f755d 100644
--- a/nova/log.py
+++ b/nova/log.py
@@ -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)