示例#1
0
 def _run(self, application, socket):
     """Start a WSGI server in a new green thread."""
     logger = logging.getLogger('eventlet.wsgi')
     eventlet.wsgi.server(socket,
                          application,
                          custom_pool=self.tg.pool,
                          log=logging.WritableLogger(logger))
示例#2
0
import jinja2
from oslo_concurrency import processutils
from oslo_utils import importutils
from oslo_utils import strutils
from oslo_utils import timeutils
from passlib import utils as passlib_utils
import six.moves.urllib.parse as urlparse

from transformer.common import cfg
from transformer.common import exception
from transformer.openstack.common import log as logging
from transformer.openstack.common import loopingcall


CONF = cfg.CONF
LOG = logging.getLogger(__name__)
import_class = importutils.import_class
import_object = importutils.import_object
import_module = importutils.import_module
bool_from_string = strutils.bool_from_string
execute = processutils.execute
isotime = timeutils.isotime

CONF = cfg.CONF
ENV = jinja2.Environment(loader=jinja2.ChoiceLoader([
                         jinja2.FileSystemLoader(CONF.template_path),
                         jinja2.PackageLoader("transformer", "templates")
                         ]))


def create_method_args_string(*args, **kwargs):
示例#3
0
from transformer.openstack.common import service

CONTEXT_KEY = 'transformer.context'
Router = base_wsgi.Router
Debug = base_wsgi.Debug
Middleware = base_wsgi.Middleware
JSONDictSerializer = base_wsgi.JSONDictSerializer
RequestDeserializer = base_wsgi.RequestDeserializer

CONF = cfg.CONF
# Raise the default from 8192 to accommodate large tokens
eventlet.wsgi.MAX_HEADER_LINE = CONF.max_header_line

eventlet.patcher.monkey_patch(all=False, socket=True)

LOG = logging.getLogger('transformer.common.wsgi')

CONF = cfg.CONF

def launch(app_name, port, paste_config_file, data={},
           host='0.0.0.0', backlog=128, threads=1000, workers=None):
    """Launches a wsgi server based on the passed in paste_config_file.

      Launch provides a easy way to create a paste app from the config
      file and launch it via the service launcher. It takes care of
      all of the plumbing. The only caveat is that the paste_config_file
      must be a file that paste.deploy can find and handle. There is
      a helper method in cfg.py that finds files.

      Example:
        conf_file = CONF.find_file(CONF.api_paste_config)