Merge "Pass version and description into oslo setup"

This commit is contained in:
Jenkins 2017-04-11 00:59:51 +00:00 committed by Gerrit Code Review
commit d70ff2ea7b
2 changed files with 29 additions and 3 deletions

View File

@ -32,6 +32,7 @@ from oslo_config import cfg
from oslo_log import log from oslo_log import log
from monasca_persister.repositories import persister from monasca_persister.repositories import persister
from monasca_persister import version
LOG = log.getLogger(__name__) LOG = log.getLogger(__name__)
@ -132,14 +133,21 @@ def start_process(respository, kafka_config):
m_persister.run() m_persister.run()
def main(): def _init_config():
log.register_options(cfg.CONF) log.register_options(cfg.CONF)
log.set_defaults() log.set_defaults()
cfg.CONF(sys.argv[1:], project='monasca', prog='persister') cfg.CONF(prog='persister',
log.setup(cfg.CONF, "monasca-persister") project='monasca',
version=version.version_str,
description='Persists metrics & alarm history in TSDB')
log.setup(cfg.CONF, 'monasca-persister', version=version.version_str)
def main():
"""Start persister.""" """Start persister."""
_init_config()
metric_repository = simport.load(cfg.CONF.repositories.metrics_driver) metric_repository = simport.load(cfg.CONF.repositories.metrics_driver)
alarm_state_history_repository = simport.load(cfg.CONF.repositories.alarm_state_history_driver) alarm_state_history_repository = simport.load(cfg.CONF.repositories.alarm_state_history_driver)

View File

@ -0,0 +1,18 @@
# Copyright 2017 FUJITSU LIMITED
#
# 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.
import pbr.version
version_info = pbr.version.VersionInfo('monasca-persister')
version_str = version_info.version_string()