def main(argv=None, config_files=None): CONF.register_cli_opt(command_opt) config.configure() sql.initialize() config.set_default_for_default_log_levels() CONF(args=argv[1:], project='keystone', version=pbr.version.VersionInfo('keystone').version_string(), usage='%(prog)s [' + '|'.join([cmd.name for cmd in CMDS]) + ']', default_config_files=config_files) config.setup_logging() CONF.command.cmd_class.main()
def configure(version=None, config_files=None, pre_setup_logging_fn=lambda: None): config.configure() sql.initialize() config.set_config_defaults() CONF(project='keystone', version=version, default_config_files=config_files) pre_setup_logging_fn() config.setup_logging() if CONF.insecure_debug: LOG.warning(_LW( 'insecure_debug is enabled so responses may include sensitive ' 'information.'))
def configure(version=None, config_files=None, pre_setup_logging_fn=lambda: None): config.configure() sql.initialize() config.set_default_for_default_log_levels() CONF(project='keystone', version=version, default_config_files=config_files) pre_setup_logging_fn() config.setup_logging() if CONF.debug: LOG.warn( _LW('debug is enabled so responses may include sensitive ' 'information.'))
from keystone import auth from keystone.common import config from keystone.common import dependency from keystone.common.kvs import core as kvs_core from keystone.common import request from keystone.common import sql from keystone import exception from keystone.identity.backends.ldap import common as ks_ldap from keystone import notifications from keystone.server import common from keystone.tests.unit import ksfixtures from keystone.version import controllers from keystone.version import service config.configure() config.set_config_defaults() PID = six.text_type(os.getpid()) TESTSDIR = os.path.dirname(os.path.abspath(__file__)) TESTCONF = os.path.join(TESTSDIR, 'config_files') ROOTDIR = os.path.normpath(os.path.join(TESTSDIR, '..', '..', '..')) VENDOR = os.path.join(ROOTDIR, 'vendor') ETCDIR = os.path.join(ROOTDIR, 'etc') def _calc_tmpdir(): env_val = os.environ.get('KEYSTONE_TEST_TEMP_DIR') if not env_val: return os.path.join(TESTSDIR, 'tmp', PID) return os.path.join(env_val, PID)
# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """Wrapper for keystone.common.config that configures itself on import.""" import os from keystone.common import config from keystone import exception config.configure() CONF = config.CONF setup_logging = config.setup_logging setup_authentication = config.setup_authentication configure = config.configure def find_paste_config(): """Find Keystone's paste.deploy configuration file. Keystone's paste.deploy configuration file is specified in the ``[paste_deploy]`` section of the main Keystone configuration file, ``keystone.conf``. For example::
def keystone_config(): from keystone.common import config config.configure()
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from keystone.common import config as keystone_config from oslo_config import cfg from oslo_log import log # NOTE(dstanek): This is oslo's world. I just live in it. log.register_options(cfg.CONF) keystone_config.configure(cfg.CONF) cfg.CONF(args=[], project='capstone', default_config_files=['etc/capstone.conf.example'])