Browse Source

Merge "Make oslo.reports an optional dependency"

changes/78/708678/5
Zuul 1 year ago
committed by Gerrit Code Review
parent
commit
b148cabdb2
  1. 10
      doc/source/admin/gmr.rst
  2. 14
      ironic/cmd/api.py
  3. 11
      ironic/cmd/conductor.py
  4. 6
      releasenotes/notes/oslo-reports-optional-59469955eaffdf1d.yaml
  5. 1
      requirements.txt
  6. 4
      setup.cfg

10
doc/source/admin/gmr.rst

@ -12,6 +12,16 @@ and more. The eventlet backdoor facility provides an interactive shell
interface for any eventlet based process, allowing an administrator to
telnet to a pre-defined port and execute a variety of commands.
Configuration
-------------
The GMR feature is optional and requires the oslo.reports_ package to be
installed. For example, using pip::
pip install 'oslo.reports>=1.18.0'
.. _oslo.reports: https://opendev.org/openstack/oslo.reports
Generating a GMR
----------------

14
ironic/cmd/api.py

@ -20,7 +20,11 @@
import sys
from oslo_config import cfg
from oslo_reports import guru_meditation_report as gmr
from oslo_log import log
try:
from oslo_reports import guru_meditation_report as gmr
except ImportError:
gmr = None
from ironic.common import profiler
from ironic.common import service as ironic_service
@ -29,12 +33,18 @@ from ironic import version
CONF = cfg.CONF
LOG = log.getLogger(__name__)
def main():
# Parse config file and command line options, then start logging
ironic_service.prepare_service(sys.argv)
gmr.TextGuruMeditation.setup_autorun(version)
if gmr is not None:
gmr.TextGuruMeditation.setup_autorun(version)
else:
LOG.debug('Guru meditation reporting is disabled '
'because oslo.reports is not installed')
profiler.setup('ironic_api', CONF.host)

11
ironic/cmd/conductor.py

@ -23,7 +23,10 @@ import sys
from oslo_config import cfg
from oslo_log import log
from oslo_reports import guru_meditation_report as gmr
try:
from oslo_reports import guru_meditation_report as gmr
except ImportError:
gmr = None
from oslo_service import service
from ironic.common import profiler
@ -83,7 +86,11 @@ def main():
# Parse config file and command line options, then start logging
ironic_service.prepare_service(sys.argv)
gmr.TextGuruMeditation.setup_autorun(version)
if gmr is not None:
gmr.TextGuruMeditation.setup_autorun(version)
else:
LOG.debug('Guru meditation reporting is disabled '
'because oslo.reports is not installed')
mgr = rpc_service.RPCService(CONF.host,
'ironic.conductor.manager',

6
releasenotes/notes/oslo-reports-optional-59469955eaffdf1d.yaml

@ -0,0 +1,6 @@
---
upgrade:
- |
The guru meditation reporting functionality is now optional and the
``oslo.reports`` package is no longer a part of requirements. Install it
manually if you need this feature.

1
requirements.txt

@ -25,7 +25,6 @@ oslo.i18n>=3.15.3 # Apache-2.0
oslo.log>=3.36.0 # Apache-2.0
oslo.middleware>=3.31.0 # Apache-2.0
oslo.policy>=1.30.0 # Apache-2.0
oslo.reports>=1.18.0 # Apache-2.0
oslo.serialization!=2.19.1,>=2.18.0 # Apache-2.0
oslo.service!=1.28.1,>=1.24.0 # Apache-2.0
oslo.upgradecheck>=0.1.0 # Apache-2.0

4
setup.cfg

@ -196,3 +196,7 @@ output_file = ironic/locale/ironic.pot
[wheel]
universal = 1
[extras]
guru_meditation_reports =
oslo.reports>=1.18.0 # Apache-2.0
Loading…
Cancel
Save