Ejemplo n.º 1
0
def init_application():
    i18n.enable_lazy()

    LOG = logging.getLogger('solum.api')

    logging.register_options(cfg.CONF)
    cfg.CONF(project='solum')
    logging.setup(cfg.CONF, 'solum')

    config.set_config_defaults()
    objects.load()

    port = cfg.CONF.api.port
    host = cfg.CONF.api.host
    LOG.info(('Starting Solum REST API on %(host)s:%(port)s'),
             {'host': host, 'port': port})
    return api_app.setup_app()
Ejemplo n.º 2
0
Archivo: api.py Proyecto: alex/solum
def main():
    service.prepare_service(sys.argv)

    app = api_app.setup_app()

    # Create the WSGI server and start it
    host, port = cfg.CONF.api.host, cfg.CONF.api.port
    srv = simple_server.make_server(host, port, app)

    LOG.info('Starting server in PID %s' % os.getpid())

    if host == '0.0.0.0':
        LOG.info('serving on 0.0.0.0:%s, view at http://127.0.0.1:%s' %
                 (port, port))
    else:
        LOG.info("serving on http://%s:%s" % (host, port))

    srv.serve_forever()
Ejemplo n.º 3
0
def main():
    service.prepare_service(sys.argv)

    app = api_app.setup_app()

    # Create the WSGI server and start it
    host, port = cfg.CONF.api.host, cfg.CONF.api.port
    srv = simple_server.make_server(host, port, app)

    LOG.info('Starting server in PID %s' % os.getpid())

    if host == '0.0.0.0':
        LOG.info('serving on 0.0.0.0:%s, view at http://127.0.0.1:%s' %
                 (port, port))
    else:
        LOG.info("serving on http://%s:%s" % (host, port))

    srv.serve_forever()
Ejemplo n.º 4
0
    def setUp(self):
        super(TestCORSMiddleware, self).setUp()

        # Config fixture
        self.CONF = self.useFixture(config.Config())
        # Disable keystone
        self.CONF.config(enable_authentication=False)
        # Make sure the options are registered before overriding them.
        self.CONF.register_opts(cors_middleware.CORS_OPTS, 'cors')
        # Set our test data overrides.
        self.CONF.config(allowed_origin="http://valid.example.com",
                         group='cors')

        # Initialize the conf object. Make sure we pass empty args=[], else the
        # testr CLI arguments will be picked up.
        cfg.CONF(project='solum', args=[])

        # Create the application.
        self.app = api_app.setup_app()
Ejemplo n.º 5
0
def init_application():
    i18n.enable_lazy()

    LOG = logging.getLogger('solum.api')

    logging.register_options(cfg.CONF)
    cfg.CONF(project='solum')
    logging.setup(cfg.CONF, 'solum')

    config.set_config_defaults()
    objects.load()

    port = cfg.CONF.api.port
    host = cfg.CONF.api.host
    LOG.info(('Starting Solum REST API on %(host)s:%(port)s'), {
        'host': host,
        'port': port
    })
    return api_app.setup_app()
Ejemplo n.º 6
0
    def setUp(self):
        super(TestCORSMiddleware, self).setUp()

        # Config fixture
        self.CONF = self.useFixture(config.Config())
        # Disable keystone
        self.CONF.config(enable_authentication=False)
        # Make sure the options are registered before overriding them.
        self.CONF.register_opts(cors_middleware.CORS_OPTS, 'cors')
        # Set our test data overrides.
        self.CONF.config(allowed_origin="http://valid.example.com",
                         group='cors')

        # Initialize the conf object. Make sure we pass empty args=[], else the
        # testr CLI arguments will be picked up.
        cfg.CONF(project='solum', args=[])

        # Create the application.
        self.app = api_app.setup_app()
Ejemplo n.º 7
0
def main():
    eventlet.monkey_patch(socket=True, select=True, time=True)
    service.prepare_service(sys.argv)

    app = api_app.setup_app()

    # Create the WSGI server and start it
    host, port = cfg.CONF.api.host, cfg.CONF.api.port

    LOG.info(_('Starting server in PID %s') % os.getpid())
    LOG.debug("Configuration:")
    logging.setup(cfg.CONF, 'solum')

    if host == '0.0.0.0':
        LOG.info(_('serving on 0.0.0.0:%(port)s, '
                   'view at http://127.0.0.1:%(port)s') %
                 dict(port=port))
    else:
        LOG.info(_('serving on http://%(host)s:%(port)s') %
                 dict(host=host, port=port))

    wsgi.server(eventlet.listen((host, port)), app)
Ejemplo n.º 8
0
def main():
    service.prepare_service(sys.argv)

    app = api_app.setup_app()

    # Create the WSGI server and start it
    host, port = cfg.CONF.api.host, cfg.CONF.api.port
    srv = simple_server.make_server(host, port, app)

    LOG.info(_('Starting server in PID %s') % os.getpid())
    LOG.debug("Configuration:")
    cfg.CONF.log_opt_values(LOG, std_logging.DEBUG)

    if host == '0.0.0.0':
        LOG.info(_('serving on 0.0.0.0:%(port)s, '
                   'view at http://127.0.0.1:%(port)s') %
                 dict(port=port))
    else:
        LOG.info(_('serving on http://%(host)s:%(port)s') %
                 dict(host=host, port=port))

    srv.serve_forever()
Ejemplo n.º 9
0
def main():
    service.prepare_service(sys.argv)

    app = api_app.setup_app()

    # Create the WSGI server and start it
    host, port = cfg.CONF.api.host, cfg.CONF.api.port
    srv = simple_server.make_server(host, port, app)

    LOG.info(_('Starting server in PID %s') % os.getpid())
    LOG.debug("Configuration:")
    cfg.CONF.log_opt_values(LOG, std_logging.DEBUG)

    if host == '0.0.0.0':
        LOG.info(
            _('serving on 0.0.0.0:%(port)s, '
              'view at http://127.0.0.1:%(port)s') % dict(port=port))
    else:
        LOG.info(
            _('serving on http://%(host)s:%(port)s') %
            dict(host=host, port=port))

    srv.serve_forever()