When building kimchi's RPM, some messages are getting
logged in /var/log/messages because cherrypy is logging
in the standard output. This happens because a function
in FeatureTests is enabling log.screen regardless of the
current environment. This patch makes a verification that
prevents the screen log to be enabled in the production
environment.
The line 'cherrypy.log.screen = True' was removed in
server.py because it has no effect. It is ignored in the
default (=production) environment and it is redundant in
dev environment because the screen log is activated by
default.
Signed-off-by: Daniel Henrique Barboza <danielhb(a)linux.vnet.ibm.com>
---
src/kimchi/featuretests.py | 6 ++++--
src/kimchi/server.py | 1 -
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/kimchi/featuretests.py b/src/kimchi/featuretests.py
index c6f4687..1310745 100644
--- a/src/kimchi/featuretests.py
+++ b/src/kimchi/featuretests.py
@@ -95,8 +95,10 @@ class FeatureTests(object):
def enable_screen_error_logging():
# Unregister the error handler
libvirt.registerErrorHandler(f=None, ctx=None)
- # Enable cherrypy screen logging
- cherrypy.log.screen = True
+ # Enable cherrypy screen logging if running environment
+ # is not 'production'
+ if cherrypy.config.get('environment') != 'production':
+ cherrypy.log.screen = True
@staticmethod
def libvirt_supports_iso_stream(protocol):
diff --git a/src/kimchi/server.py b/src/kimchi/server.py
index 8d166e5..46f128c 100644
--- a/src/kimchi/server.py
+++ b/src/kimchi/server.py
@@ -91,7 +91,6 @@ class Server(object):
max_body_size_in_bytes = eval(options.max_body_size) * 1024
cherrypy.server.max_request_body_size = max_body_size_in_bytes
- cherrypy.log.screen = True
cherrypy.log.access_file = options.access_log
cherrypy.log.error_file = options.error_log
--
1.8.3.1