上一篇提到,函数_run_wsgi中加载配置操作load_paste_app,看代码直观一些,如下所示
def _run_wsgi(app_name):
app = config.load_paste_app(app_name)
if not app:
LOG.error(_LE('No known API applications configured.'))
return
server = wsgi.Server("Neutron")
server.start(app, cfg.CONF.bind_port, cfg.CONF.bind_host,
workers=_get_api_workers())
LOG.info(_LI("Neutron service started, listening on %(host)s:%(port)s"),
{'host': cfg.CONF.bind_host, 'port': cfg.CONF.bind_port})
return server
继续跟踪load_paste_app函数,在neutron.common.config中定义了该函数有(注意,习惯用模块导入的格式写代码的路径,比如neutron.common.config实际上是neutron/common/config.py,下面的所有都是这种情况)
def load_paste_app(app_name):
"""