Merge "Add WSGI support for octavia api"
This commit is contained in:
commit
ff059e03f3
@ -16,6 +16,7 @@ import pecan
|
||||
|
||||
from octavia.api import config as app_config
|
||||
from octavia.api.v1 import hooks
|
||||
from octavia.common import service as octavia_service
|
||||
|
||||
|
||||
def get_pecan_config():
|
||||
@ -24,8 +25,10 @@ def get_pecan_config():
|
||||
return pecan.configuration.conf_from_file(filename)
|
||||
|
||||
|
||||
def setup_app(pecan_config=None, debug=False):
|
||||
def setup_app(pecan_config=None, debug=False, argv=None):
|
||||
"""Creates and returns a pecan wsgi app."""
|
||||
octavia_service.prepare_service(argv)
|
||||
|
||||
app_hooks = [hooks.ContextHook()]
|
||||
|
||||
if not pecan_config:
|
||||
|
@ -22,7 +22,6 @@ from oslo_log import log as logging
|
||||
from oslo_reports import guru_meditation_report as gmr
|
||||
|
||||
from octavia.api import app as api_app
|
||||
from octavia.common import service as octavia_service
|
||||
from octavia.i18n import _LI
|
||||
from octavia import version
|
||||
|
||||
@ -31,11 +30,9 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def main():
|
||||
octavia_service.prepare_service(sys.argv)
|
||||
|
||||
gmr.TextGuruMeditation.setup_autorun(version)
|
||||
|
||||
app = api_app.setup_app()
|
||||
app = api_app.setup_app(argv=sys.argv)
|
||||
|
||||
host, port = cfg.CONF.bind_host, cfg.CONF.bind_port
|
||||
LOG.info(_LI("Starting API server on %(host)s:%(port)s"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user