def main(): try: config.parse_args() config.set_config_defaults() wsgi.set_eventlet_hub() logging.setup(CONF, 'searchlight') utils.register_plugin_opts() # Fail fast if service policy files aren't found service_policies.check_policy_files() if CONF.profiler.enabled: _notifier = osprofiler.notifier.create("Messaging", notifier.messaging, {}, notifier.get_transport(), "searchlight", "search", CONF.api.bind_host) osprofiler.notifier.set(_notifier) else: osprofiler.web.disable() server = wsgi.Server(workers=CONF.api.workers) server.start(config.load_paste_app('searchlight'), default_port=9393) server.wait() except KNOWN_EXCEPTIONS as e: fail(e)
def prepare_service(argv=None): oslo_i18n.enable_lazy() log.set_defaults(_DEFAULT_LOG_LEVELS) log.register_options(CONF) gmr.TextGuruMeditation.setup_autorun(version) utils.register_plugin_opts() if argv is None: argv = sys.argv CONF(argv[1:], project='searchlight') log.setup(cfg.CONF, 'searchlight') oslo_messaging.set_transport_defaults('searchlight')
def configure_wsgi(): config.parse_args() config.set_config_defaults() logging.setup(CONF, 'searchlight') utils.register_plugin_opts() # Fail fast if service policy files aren't found service_policies.check_policy_files() if CONF.profiler.enabled: _notifier = osprofiler.notifier.create("Messaging", notifier.messaging, {}, notifier.get_transport(), "searchlight", "search", CONF.api.bind_host) osprofiler.notifier.set(_notifier) else: osprofiler.web.disable()
def setUp(self): super(BaseTestCase, self).setUp() # NOTE(bcwaldon): parse_args has to be called to register certain # command-line options - specifically we need config_dir for # the following policy tests config.parse_args(args=[]) self.addCleanup(CONF.reset) mox_fixture = self.useFixture(moxstubout.MoxStubout()) self.stubs = mox_fixture.stubs self.stubs.Set(exception, "_FATAL_EXCEPTION_FORMAT_ERRORS", True) self.test_dir = self.useFixture(fixtures.TempDir()).path self.conf_dir = os.path.join(self.test_dir, "etc") utils.safe_mkdirs(self.conf_dir) self.set_policy() utils.register_plugin_opts()
def setUp(self): super(BaseTestCase, self).setUp() # NOTE(bcwaldon): parse_args has to be called to register certain # command-line options - specifically we need config_dir for # the following policy tests config.parse_args(args=[], default_config_files=[]) self.addCleanup(CONF.reset) mox_fixture = self.useFixture(moxstubout.MoxStubout()) self.stubs = mox_fixture.stubs self.stubs.Set(exception, '_FATAL_EXCEPTION_FORMAT_ERRORS', True) self.test_dir = self.useFixture(fixtures.TempDir()).path self.conf_dir = os.path.join(self.test_dir, 'etc') utils.safe_mkdirs(self.conf_dir) self.set_policy() utils.register_plugin_opts()
def setUp(self): super(BaseTestCase, self).setUp() # NOTE(bcwaldon): parse_args has to be called to register certain # command-line options - specifically we need config_dir for # the following policy tests config.parse_args(args=[], default_config_files=[]) self.addCleanup(CONF.reset) self.mock_exception = mock.patch('searchlight.common.exception', True) self.mock_exception.start() self.test_dir = self.useFixture(fixtures.TempDir()).path self.conf_dir = os.path.join(self.test_dir, 'etc') utils.safe_mkdirs(self.conf_dir) service_policies._ENFORCERS = None self.set_policy() utils.register_plugin_opts()
def configure_wsgi(): # NOTE(hberaud): Call reset to ensure the ConfigOpts object doesn't # already contain registered options if the app is reloaded. CONF.reset() config.parse_args() config.set_config_defaults() logging.setup(CONF, 'searchlight') gmr.TextGuruMeditation.setup_autorun(version) utils.register_plugin_opts() # Fail fast if service policy files aren't found service_policies.check_policy_files() if CONF.profiler.enabled: _notifier = osprofiler.notifier.create("Messaging", notifier.messaging, {}, notifier.get_transport(), "searchlight", "search", CONF.api.bind_host) osprofiler.notifier.set(_notifier) else: osprofiler.web.disable()
def setUp(self): super(BaseTestCase, self).setUp() # NOTE(bcwaldon): parse_args has to be called to register certain # command-line options - specifically we need config_dir for # the following policy tests config.parse_args(args=[], default_config_files=[]) self.addCleanup(CONF.reset) mox_fixture = self.useFixture(moxstubout.MoxStubout()) self.stubs = mox_fixture.stubs self.mock_exception = mock.patch( 'searchlight.common.exception', True) self.mock_exception.start() self.test_dir = self.useFixture(fixtures.TempDir()).path self.conf_dir = os.path.join(self.test_dir, 'etc') utils.safe_mkdirs(self.conf_dir) service_policies._ENFORCERS = None self.set_policy() utils.register_plugin_opts()
def main(): try: config.parse_args() wsgi.set_eventlet_hub() logging.setup(CONF, 'searchlight') utils.register_plugin_opts() if CONF.profiler.enabled: _notifier = osprofiler.notifier.create("Messaging", notifier.messaging, {}, notifier.get_transport(), "searchlight", "search", CONF.api.bind_host) osprofiler.notifier.set(_notifier) else: osprofiler.web.disable() server = wsgi.Server(workers=CONF.api.workers) server.start(config.load_paste_app('searchlight'), default_port=9393) server.wait() except KNOWN_EXCEPTIONS as e: fail(e)
def __init__(self): utils.register_plugin_opts()