From: Ivan Kolodyazhny Date: Tue, 16 Feb 2016 16:49:54 +0000 (+0200) Subject: Add 'conf' param for TextGuruMeditation autorun setup X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=68a92ea462e9378dcf5d835fda37b1b0001768b7;p=openstack-build%2Fcinder-build.git Add 'conf' param for TextGuruMeditation autorun setup Guru Meditation Report (GMR) supports report generation to file in a configured directory. By default it will genarate report to stdout stream. To configure GMR you have to add the following section to cinder.conf: [oslo_reports] log_dir = '/path/to/logs/dir' DocImpact Change-Id: Ia32cae8e4fe937f2512693acb7fcc552f01efa01 Closes-Bug: #1546199 --- diff --git a/cinder/cmd/all.py b/cinder/cmd/all.py index ceee9c9c8..705fbff06 100644 --- a/cinder/cmd/all.py +++ b/cinder/cmd/all.py @@ -33,6 +33,7 @@ import sys from oslo_config import cfg from oslo_log import log as logging from oslo_reports import guru_meditation_report as gmr +from oslo_reports import opts as gmr_opts from cinder import i18n i18n.enable_lazy() @@ -55,6 +56,7 @@ CONF = cfg.CONF # TODO(e0ne): get a rid of code duplication in cinder.cmd module in Mitaka def main(): objects.register_all() + gmr_opts.set_defaults(CONF) CONF(sys.argv[1:], project='cinder', version=version.version_string()) logging.setup(CONF, "cinder") @@ -62,7 +64,7 @@ def main(): utils.monkey_patch() - gmr.TextGuruMeditation.setup_autorun(version) + gmr.TextGuruMeditation.setup_autorun(version, conf=CONF) rpc.init(CONF) diff --git a/cinder/cmd/api.py b/cinder/cmd/api.py index 9057883c5..0115b1f4e 100644 --- a/cinder/cmd/api.py +++ b/cinder/cmd/api.py @@ -27,6 +27,7 @@ from cinder import objects from oslo_config import cfg from oslo_log import log as logging from oslo_reports import guru_meditation_report as gmr +from oslo_reports import opts as gmr_opts from cinder import i18n i18n.enable_lazy() @@ -44,12 +45,13 @@ CONF = cfg.CONF def main(): objects.register_all() + gmr_opts.set_defaults(CONF) CONF(sys.argv[1:], project='cinder', version=version.version_string()) logging.setup(CONF, "cinder") utils.monkey_patch() - gmr.TextGuruMeditation.setup_autorun(version) + gmr.TextGuruMeditation.setup_autorun(version, conf=CONF) rpc.init(CONF) launcher = service.process_launcher() diff --git a/cinder/cmd/backup.py b/cinder/cmd/backup.py index cc265e535..1ac0b2b00 100644 --- a/cinder/cmd/backup.py +++ b/cinder/cmd/backup.py @@ -23,6 +23,7 @@ import eventlet from oslo_config import cfg from oslo_log import log as logging from oslo_reports import guru_meditation_report as gmr +from oslo_reports import opts as gmr_opts eventlet.monkey_patch() @@ -42,11 +43,12 @@ CONF = cfg.CONF def main(): objects.register_all() + gmr_opts.set_defaults(CONF) CONF(sys.argv[1:], project='cinder', version=version.version_string()) logging.setup(CONF, "cinder") utils.monkey_patch() - gmr.TextGuruMeditation.setup_autorun(version) + gmr.TextGuruMeditation.setup_autorun(version, conf=CONF) server = service.Service.create(binary='cinder-backup') service.serve(server) service.wait() diff --git a/cinder/cmd/scheduler.py b/cinder/cmd/scheduler.py index bea47e2b6..706330f84 100644 --- a/cinder/cmd/scheduler.py +++ b/cinder/cmd/scheduler.py @@ -25,6 +25,7 @@ import sys from oslo_config import cfg from oslo_log import log as logging from oslo_reports import guru_meditation_report as gmr +from oslo_reports import opts as gmr_opts from cinder import i18n i18n.enable_lazy() @@ -42,11 +43,12 @@ CONF = cfg.CONF def main(): objects.register_all() + gmr_opts.set_defaults(CONF) CONF(sys.argv[1:], project='cinder', version=version.version_string()) logging.setup(CONF, "cinder") utils.monkey_patch() - gmr.TextGuruMeditation.setup_autorun(version) + gmr.TextGuruMeditation.setup_autorun(version, conf=CONF) server = service.Service.create(binary='cinder-scheduler') service.serve(server) service.wait() diff --git a/cinder/cmd/volume.py b/cinder/cmd/volume.py index c9877aefe..31013e7d6 100644 --- a/cinder/cmd/volume.py +++ b/cinder/cmd/volume.py @@ -35,6 +35,7 @@ import sys from oslo_config import cfg from oslo_log import log as logging from oslo_reports import guru_meditation_report as gmr +from oslo_reports import opts as gmr_opts from cinder import i18n i18n.enable_lazy() @@ -57,11 +58,12 @@ CONF = cfg.CONF def main(): objects.register_all() + gmr_opts.set_defaults(CONF) CONF(sys.argv[1:], project='cinder', version=version.version_string()) logging.setup(CONF, "cinder") utils.monkey_patch() - gmr.TextGuruMeditation.setup_autorun(version) + gmr.TextGuruMeditation.setup_autorun(version, conf=CONF) launcher = service.get_launcher() LOG = logging.getLogger(__name__) service_started = False