Exemplo n.º 1
0
def initialize_application(name, post_log_configured_function=lambda: None):
    common.configure()

    # Log the options used when starting if we're in debug mode...
    if CONF.debug:
        CONF.log_opt_values(logging.getLogger(CONF.prog), logging.DEBUG)

    environment.use_stdlib()

    post_log_configured_function()

    def loadapp():
        return keystone_service.loadapp(
            'config:%s' % config.find_paste_config(), name)

    _unused, application = common.setup_backends(
        startup_application_fn=loadapp)

    # Create a CORS wrapper, and attach keystone-specific defaults that must be
    # included in all CORS responses
    application = cors.CORS(application, CONF)
    application.set_latent(
        allow_headers=KEYSTONE_HEADERS,
        allow_methods=['GET', 'PUT', 'POST', 'DELETE', 'PATCH'],
        expose_headers=KEYSTONE_HEADERS)
    return application
Exemplo n.º 2
0
def initialize_application(name):
    common.configure()

    # Log the options used when starting if we're in debug mode...
    if CONF.debug:
        CONF.log_opt_values(logging.getLogger(CONF.prog), logging.DEBUG)

    environment.use_stdlib()

    def loadapp():
        return keystone_service.loadapp(
            'config:%s' % config.find_paste_config(), name)

    _unused, application = common.setup_backends(
        startup_application_fn=loadapp)

    # Create a CORS wrapper, and attach keystone-specific defaults that must be
    # included in all CORS responses
    application = cors.CORS(application, CONF)
    application.set_latent(
        allow_headers=KEYSTONE_HEADERS,
        allow_methods=['GET', 'PUT', 'POST', 'DELETE', 'PATCH'],
        expose_headers=KEYSTONE_HEADERS
    )
    return application
Exemplo n.º 3
0
def main():
    environment.use_stdlib()

    dev_conf = os.path.join(possible_topdir, 'etc', 'keystone.conf')
    config_files = None
    if os.path.exists(dev_conf):
        config_files = [dev_conf]

    cli.main(argv=sys.argv, config_files=config_files)
Exemplo n.º 4
0
def main():
    environment.use_stdlib()

    dev_conf = os.path.join(possible_topdir,
                            'etc',
                            'keystone.conf')
    config_files = None
    if os.path.exists(dev_conf):
        config_files = [dev_conf]

    cli.main(argv=sys.argv, config_files=config_files)
Exemplo n.º 5
0
def initialize_application(name):
    common.configure()

    # Log the options used when starting if we're in debug mode...
    if CONF.debug:
        CONF.log_opt_values(logging.getLogger(CONF.prog), logging.DEBUG)

    environment.use_stdlib()

    def loadapp():
        return keystone_service.loadapp("config:%s" % config.find_paste_config(), name)

    _unused, application = common.setup_backends(startup_application_fn=loadapp)
    return application
Exemplo n.º 6
0
def initialize_application(name):
    common.configure()

    # Log the options used when starting if we're in debug mode...
    if CONF.debug:
        CONF.log_opt_values(logging.getLogger(CONF.prog), logging.DEBUG)

    environment.use_stdlib()

    def loadapp():
        return keystone_service.loadapp(
            'config:%s' % config.find_paste_config(), name)

    _unused, application = common.setup_backends(
        startup_application_fn=loadapp)
    return application
Exemplo n.º 7
0
from keystone.common import environment
from keystone.common import sql
from keystone import config
from keystone.openstack.common import log
from keystone import service


CONF = config.CONF

config.configure()
sql.initialize()
config.set_default_for_default_log_levels()

CONF(project='keystone')
config.setup_logging()

environment.use_stdlib()
name = os.path.basename(__file__)

if CONF.debug:
    CONF.log_opt_values(log.getLogger(CONF.prog), logging.DEBUG)


drivers = backends.load_backends()

# NOTE(ldbragst): 'application' is required in this context by WSGI spec.
# The following is a reference to Python Paste Deploy documentation
# http://pythonpaste.org/deploy/
application = service.loadapp('config:%s' % config.find_paste_config(), name)

dependency.resolve_future_dependencies()