Merge pull request #129 from rackerlabs/gunicorn_fix

Fix Gunicorn server config
This commit is contained in:
Jason Meridth
2014-05-08 14:43:50 -05:00

View File

@@ -14,21 +14,21 @@ from neutron import service # noqa For api_workers config value
options = [ options = [
cfg.StringOpt('access_log', cfg.StrOpt('access_log',
default='/var/log/neutron/http_access.log', default='/var/log/neutron/http_access.log',
help='The Access log file to write to.'), help='The Access log file to write to.'),
cfg.StringOpt('error_log', cfg.StrOpt('error_log',
default='/var/log/neutron/http_error.log', default='/var/log/neutron/http_error.log',
help='The Error log file to write to.'), help='The Error log file to write to.'),
cfg.StringOpt('worker_class', cfg.StrOpt('worker_class',
default='eventlet', default='eventlet',
help='The type of workers to use.'), help='The type of workers to use.'),
cfg.IntOpt('limit_request_line', cfg.IntOpt('limit_request_line',
default=0, default=0,
help='The maximum size of HTTP request line in bytes.'), help='The maximum size of HTTP request line in bytes.'),
cfg.StringOpt('loglevel', cfg.StrOpt('loglevel',
default='debug', default='debug',
help='The granularity of Error log outputs.'), help='The granularity of Error log outputs.'),
] ]
cfg.CONF.register_opts(options, 'gunicorn') cfg.CONF.register_opts(options, 'gunicorn')
@@ -46,12 +46,12 @@ class Neutron(base.Application):
self.cfg = gconfig.Config(self.usage, prog=self.prog) self.cfg = gconfig.Config(self.usage, prog=self.prog)
settings = {'bind': '%s:%s' % (cfg.CONF.bind_host, cfg.CONF.bind_port), settings = {'bind': '%s:%s' % (cfg.CONF.bind_host, cfg.CONF.bind_port),
'workers': cfg.CONF.api_workers, 'workers': cfg.CONF.api_workers,
'worker_class': cfg.CONF.worker_class, 'worker_class': cfg.CONF.gunicorn.worker_class,
'proc_name': 'neutron-server', 'proc_name': 'neutron-server',
'accesslog': cfg.CONF.access_log, 'accesslog': cfg.CONF.gunicorn.access_log,
'errorlog': cfg.CONF.error_log, 'errorlog': cfg.CONF.gunicorn.error_log,
'limit_request_line': cfg.CONF.limit_request_line, 'limit_request_line': cfg.CONF.gunicorn.limit_request_line,
'loglevel': cfg.CONF.loglevel, 'loglevel': cfg.CONF.gunicorn.loglevel,
'access_log_format': ' '.join(('%(h)s', 'access_log_format': ' '.join(('%(h)s',
'%(l)s', '%(l)s',
'%(u)s', '%(u)s',