diff --git a/dashboard/web.py b/dashboard/web.py index 208d5b96a..87400294f 100644 --- a/dashboard/web.py +++ b/dashboard/web.py @@ -33,7 +33,6 @@ from stackalytics.openstack.common import log as logging from stackalytics.processor import config from stackalytics.processor import utils - # Application objects --------- app = flask.Flask(__name__) @@ -47,14 +46,6 @@ LOG = logging.getLogger(__name__) conf = cfg.CONF conf.register_opts(config.OPTS) -conf_file = os.getenv('STACKALYTICS_CONF') -if conf_file and os.path.isfile(conf_file): - conf(default_config_files=[conf_file]) - app.config['DEBUG'] = cfg.CONF.debug - -logging.setup('dashboard') -LOG.info('Stackalytics.dashboard is configured via "%s"', conf_file) - # Handlers --------- @@ -602,6 +593,16 @@ def remove_ctrl_chars(text): def main(): + conf_file = os.getenv('STACKALYTICS_CONF') + if conf_file and os.path.isfile(conf_file): + conf(default_config_files=[conf_file]) + app.config['DEBUG'] = cfg.CONF.debug + LOG.info('Stackalytics.dashboard is configured via "%s"', conf_file) + else: + conf(project='stackalytics') + + logging.setup('dashboard') + app.run(cfg.CONF.listen_host, cfg.CONF.listen_port) if __name__ == '__main__': diff --git a/stackalytics/processor/main.py b/stackalytics/processor/main.py index ecc491c46..a980fbf71 100644 --- a/stackalytics/processor/main.py +++ b/stackalytics/processor/main.py @@ -263,7 +263,7 @@ def main(): conf = cfg.CONF conf.register_cli_opts(config.OPTS) conf.register_opts(config.OPTS) - conf() + conf(project='stackalytics') logging.setup('stackalytics') LOG.info('Logging enabled')