From 5fd6b4c768f456e254c29a9ab8ef563774297dc9 Mon Sep 17 00:00:00 2001 From: Duan Jiong Date: Tue, 14 Mar 2017 14:23:26 +0800 Subject: [PATCH] Pass parameters when create eventlet.wsgi server Otherwise, config option wsgi_log_format in neutron.conf will not work Closes-Bug: #1672615 Change-Id: I43a3b6d99f940b5276aabaccad15d1050023baa2 --- neutron/agent/linux/utils.py | 3 ++- neutron/tests/unit/agent/linux/test_utils.py | 3 +++ neutron/tests/unit/test_wsgi.py | 1 + neutron/wsgi.py | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/neutron/agent/linux/utils.py b/neutron/agent/linux/utils.py index eaef17753cf..81d41cc6626 100644 --- a/neutron/agent/linux/utils.py +++ b/neutron/agent/linux/utils.py @@ -432,4 +432,5 @@ class UnixDomainWSGIServer(wsgi.Server): application, max_size=self.num_threads, protocol=UnixDomainHttpProtocol, - log=logger) + log=logger, + log_format=cfg.CONF.wsgi_log_format) diff --git a/neutron/tests/unit/agent/linux/test_utils.py b/neutron/tests/unit/agent/linux/test_utils.py index 8037c7b4f9f..a9874cb53c5 100644 --- a/neutron/tests/unit/agent/linux/test_utils.py +++ b/neutron/tests/unit/agent/linux/test_utils.py @@ -19,6 +19,7 @@ import mock import six import testtools +from oslo_config import cfg import oslo_i18n from neutron.agent.linux import utils @@ -513,6 +514,7 @@ class TestUnixDomainWSGIServer(base.BaseTestCase): 'app', protocol=utils.UnixDomainHttpProtocol, log=mock.ANY, + log_format=cfg.CONF.wsgi_log_format, max_size=self.server.num_threads ) @@ -527,5 +529,6 @@ class TestUnixDomainWSGIServer(base.BaseTestCase): 'app', protocol=utils.UnixDomainHttpProtocol, log=mock.ANY, + log_format=cfg.CONF.wsgi_log_format, max_size=num_threads ) diff --git a/neutron/tests/unit/test_wsgi.py b/neutron/tests/unit/test_wsgi.py index a8cfedd5b8e..c7e60c274ea 100644 --- a/neutron/tests/unit/test_wsgi.py +++ b/neutron/tests/unit/test_wsgi.py @@ -205,6 +205,7 @@ class TestWSGIServer(base.BaseTestCase): max_size=server.num_threads, log=mock.ANY, keepalive=CONF.wsgi_keep_alive, + log_format=CONF.wsgi_log_format, socket_timeout=server.client_socket_timeout ) diff --git a/neutron/wsgi.py b/neutron/wsgi.py index 08e43a145d7..18d64ddc211 100644 --- a/neutron/wsgi.py +++ b/neutron/wsgi.py @@ -221,6 +221,7 @@ class Server(object): max_size=self.num_threads, log=LOG, keepalive=CONF.wsgi_keep_alive, + log_format=CONF.wsgi_log_format, socket_timeout=self.client_socket_timeout)