Fixes unusable Guru meditation report

GMR requires configuring a path for storing the report via [oslo_reports]log_dir,
this is empty by default, and currently there is no means to specify this option,
thus doesn't respond with SIGUSR2.

Though gmr is optional, test requirement is still required so that we can
generate proper configuration sample for it.

Story: 2007570
Task: 39467

Change-Id: I0f03e9d01a3c4e42a4fc8bf2d8ceb2d1a587056c
This commit is contained in:
Kaifeng Wang 2020-04-18 14:35:21 +08:00
parent 7afd1698b9
commit dcc049768b
5 changed files with 13 additions and 1 deletions

View File

@ -23,6 +23,7 @@ from oslo_config import cfg
from oslo_log import log from oslo_log import log
try: try:
from oslo_reports import guru_meditation_report as gmr from oslo_reports import guru_meditation_report as gmr
from oslo_reports import opts as gmr_opts
except ImportError: except ImportError:
gmr = None gmr = None
@ -41,6 +42,7 @@ def main():
ironic_service.prepare_service(sys.argv) ironic_service.prepare_service(sys.argv)
if gmr is not None: if gmr is not None:
gmr_opts.set_defaults(CONF)
gmr.TextGuruMeditation.setup_autorun(version) gmr.TextGuruMeditation.setup_autorun(version)
else: else:
LOG.debug('Guru meditation reporting is disabled ' LOG.debug('Guru meditation reporting is disabled '

View File

@ -25,6 +25,7 @@ from oslo_config import cfg
from oslo_log import log from oslo_log import log
try: try:
from oslo_reports import guru_meditation_report as gmr from oslo_reports import guru_meditation_report as gmr
from oslo_reports import opts as gmr_opts
except ImportError: except ImportError:
gmr = None gmr = None
from oslo_service import service from oslo_service import service
@ -87,7 +88,8 @@ def main():
ironic_service.prepare_service(sys.argv) ironic_service.prepare_service(sys.argv)
if gmr is not None: if gmr is not None:
gmr.TextGuruMeditation.setup_autorun(version) gmr_opts.set_defaults(CONF)
gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
else: else:
LOG.debug('Guru meditation reporting is disabled ' LOG.debug('Guru meditation reporting is disabled '
'because oslo.reports is not installed') 'because oslo.reports is not installed')

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Fixes state report via Guru Meditation Reports that did not work
previously because of empty ``log_dir`` and no way to configure
this configuration option.

View File

@ -10,6 +10,7 @@ mock>=3.0.0 # BSD
Babel!=2.4.0,>=2.3.4 # BSD Babel!=2.4.0,>=2.3.4 # BSD
PyMySQL>=0.7.6 # MIT License PyMySQL>=0.7.6 # MIT License
iso8601>=0.1.11 # MIT iso8601>=0.1.11 # MIT
oslo.reports>=1.18.0 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0
stestr>=1.0.0 # Apache-2.0 stestr>=1.0.0 # Apache-2.0
psycopg2>=2.7.3 # LGPL/ZPL psycopg2>=2.7.3 # LGPL/ZPL

View File

@ -17,6 +17,7 @@ namespace = oslo.middleware.http_proxy_to_wsgi
namespace = oslo.concurrency namespace = oslo.concurrency
namespace = oslo.policy namespace = oslo.policy
namespace = oslo.log namespace = oslo.log
namespace = oslo.reports
namespace = oslo.service.service namespace = oslo.service.service
namespace = oslo.service.periodic_task namespace = oslo.service.periodic_task
namespace = oslo.service.sslutils namespace = oslo.service.sslutils