def setUp(self): super(BaseTestCase, self).setUp() self._config_fixture = self.useFixture(cfg_fixture.Config()) config.parse_args(args=[]) self.addCleanup(CONF.reset) 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()
def setUp(self): super(BaseTestCase, self).setUp() self._config_fixture = self.useFixture(cfg_fixture.Config()) # 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) 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()
def main(): try: config.parse_args() wsgi.set_eventlet_hub() logging.setup(CONF, 'glare') if cfg.CONF.profiler.enabled: _notifier = osprofiler.notifier.create( "Messaging", oslo_messaging, {}, notification.get_transport(), "glare", "artifacts", cfg.CONF.bind_host) osprofiler.notifier.set(_notifier) else: osprofiler.web.disable() server = wsgi.Server(initialize_glance_store=True) server.start(config.load_paste_app('glare-api'), default_port=9494) server.wait() except KNOWN_EXCEPTIONS as e: fail(e)
def main(): try: config.parse_args() wsgi.set_eventlet_hub() logging.setup(CONF, 'glare') notification.set_defaults() if CONF.profiler.enabled: initializer.init_from_conf( conf=CONF, context={}, project="glare", service="api", host=CONF.bind_host ) server = wsgi.Server(initialize_glance_store=True) server.start(config.load_paste_app('glare-api'), default_port=9494) server.wait() except KNOWN_EXCEPTIONS as e: fail(e)
def main(): CONF.register_cli_opts(scrubber.scrubber_cmd_cli_opts, group='scrubber') CONF.register_opts(scrubber.scrubber_cmd_opts, group='scrubber') try: config.parse_args() logging.setup(CONF, 'glare') glance_store.register_opts(config.CONF) glance_store.create_stores(config.CONF) glance_store.verify_default_store() app = scrubber.Scrubber() if CONF.scrubber.daemon: server = scrubber.Daemon(CONF.scrubber.wakeup_time) server.start(app) server.wait() else: app.run() except RuntimeError as e: sys.exit("ERROR: %s" % e)
uwsgi --module glare.wsgi:application --socket 127.0.0.1:8008 Sample apache mod_wsgi configuration: <VirtualHost *:80> ServerName example.com SetEnv GLARE_CONFIG_FILE=/etc/glare/glare.conf DocumentRoot /path/to/public_html/ WSGIScriptAlias / /usr/lib/python2.7/site-packages/glare/wsgi.py ... </VirtualHost> """ import os from oslo_config import cfg from oslo_log import log as logging from glare.common import config from glare.common import utils CONF = cfg.CONF logging.register_options(CONF) CONFIG_FILE = os.environ.get("GLARE_CONFIG_FILE", "etc/glare.conf") config.parse_args(args=["--config-file", CONFIG_FILE]) utils.initialize_glance_store() application = config.load_paste_app('glare-api')