diff --git a/bin/heat-api b/bin/heat-api index e252e6042c..5082ec0012 100755 --- a/bin/heat-api +++ b/bin/heat-api @@ -35,7 +35,6 @@ gettext.install('heat', unicode=1) from heat.common import config from heat.common import wsgi -from paste import httpserver from heat.openstack.common import cfg from heat.openstack.common import log as logging @@ -52,7 +51,9 @@ if __name__ == '__main__': port = cfg.CONF.bind_port host = cfg.CONF.bind_host - LOG.info(('Starting Heat API on %s:%s') % (host, port)) - httpserver.serve(app, host=host, port=port) + LOG.info('Starting Heat API on %s:%s' % (host, port)) + server = wsgi.Server() + server.start(app, cfg.CONF, default_port=port) + server.wait() except RuntimeError, e: sys.exit("ERROR: %s" % e) diff --git a/bin/heat-metadata b/bin/heat-metadata index 2a927e230c..6c6fe4d6e9 100755 --- a/bin/heat-metadata +++ b/bin/heat-metadata @@ -37,7 +37,6 @@ from heat.openstack.common import rpc from heat.common import config from heat.common import wsgi from heat.common import context -from paste import httpserver from heat.openstack.common import log as logging from heat.openstack.common import cfg @@ -76,6 +75,8 @@ if __name__ == '__main__': host = cfg.CONF.bind_host send_address_to_engine(host, port) LOG.info(('Starting Heat Metadata on %s:%s') % (host, port)) - httpserver.serve(app, host=host, port=port) + server = wsgi.Server() + server.start(app, cfg.CONF, default_port=port) + server.wait() except RuntimeError, e: sys.exit("ERROR: %s" % e) diff --git a/heat/common/config.py b/heat/common/config.py index c5c5a0a6ca..081cf18017 100644 --- a/heat/common/config.py +++ b/heat/common/config.py @@ -226,9 +226,6 @@ def load_paste_app(app_name=None): raise RuntimeError("Unable to locate config file") try: - # Setup logging early - setup_logging() - app = wsgi.paste_deploy_app(conf_file, app_name, cfg.CONF) # Log the options used when starting if we're in debug mode... diff --git a/heat/common/wsgi.py b/heat/common/wsgi.py index 0118f14f06..ecf0ae75d3 100644 --- a/heat/common/wsgi.py +++ b/heat/common/wsgi.py @@ -47,6 +47,10 @@ from heat.openstack.common import cfg from heat.openstack.common import importutils from heat.openstack.common import utils + +# TODO(shadower) remove this once eventlet with fix from #55 gets released +eventlet.wsgi.MAX_REQUEST_LINE = 50000 + bind_opts = [ cfg.StrOpt('bind_host', default='0.0.0.0'), cfg.IntOpt('bind_port'), @@ -74,7 +78,9 @@ class WritableLogger(object): def get_bind_addr(conf, default_port=None): """Return the host and port to bind to.""" - conf.register_opts(bind_opts) + for opt in bind_opts: + if not opt.name in conf: + conf.register_opt(opt) return (conf.bind_host, conf.bind_port or default_port)