Merge "Pass config object to oslo_reports"

This commit is contained in:
Jenkins 2017-09-06 16:06:13 +00:00 committed by Gerrit Code Review
commit 7b3ffa7662
13 changed files with 53 additions and 12 deletions

View File

@ -24,6 +24,7 @@ import sys
from oslo_log import log as logging
from oslo_reports import guru_meditation_report as gmr
from oslo_reports import opts as gmr_opts
import nova.conf
from nova import config
@ -41,13 +42,14 @@ def main():
logging.setup(CONF, "nova")
utils.monkey_patch()
objects.register_all()
gmr_opts.set_defaults(CONF)
if 'osapi_compute' in CONF.enabled_apis:
# NOTE(mriedem): This is needed for caching the nova-compute service
# version.
objects.Service.enable_min_version_cache()
log = logging.getLogger(__name__)
gmr.TextGuruMeditation.setup_autorun(version)
gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
launcher = service.process_launcher()
started = 0

View File

@ -20,6 +20,7 @@ import sys
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 nova.conductor import rpcapi as conductor_rpcapi
import nova.conf
@ -39,8 +40,9 @@ def main():
logging.setup(CONF, "nova")
utils.monkey_patch()
objects.register_all()
gmr_opts.set_defaults(CONF)
gmr.TextGuruMeditation.setup_autorun(version)
gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
objects_base.NovaObject.indirection_api = conductor_rpcapi.ConductorAPI()

View File

@ -20,6 +20,7 @@ import sys
from oslo_log import log as logging
from oslo_reports import guru_meditation_report as gmr
from oslo_reports import opts as gmr_opts
import nova.conf
from nova import config
@ -37,11 +38,12 @@ def main():
logging.setup(CONF, "nova")
utils.monkey_patch()
objects.register_all()
gmr_opts.set_defaults(CONF)
# NOTE(mriedem): This is needed for caching the nova-compute service
# version.
objects.Service.enable_min_version_cache()
gmr.TextGuruMeditation.setup_autorun(version)
gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
should_use_ssl = 'osapi_compute' in CONF.enabled_ssl_apis
server = service.WSGIService('osapi_compute', use_ssl=should_use_ssl)

View File

@ -22,6 +22,7 @@ import sys
from oslo_log import log as logging
from oslo_reports import guru_meditation_report as gmr
from oslo_reports import opts as gmr_opts
import nova.conf
from nova.conf import novnc
@ -31,6 +32,7 @@ from nova import version
CONF = nova.conf.CONF
novnc.register_cli_opts(CONF)
gmr_opts.set_defaults(CONF)
def exit_with_error(msg, errno=-1):
@ -49,7 +51,7 @@ def proxy(host, port):
logging.setup(CONF, "nova")
gmr.TextGuruMeditation.setup_autorun(version)
gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
# Create and start the NovaWebSockets proxy
websocketproxy.NovaWebSocketProxy(

View File

@ -19,6 +19,7 @@ import sys
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 nova import cells
import nova.conf
@ -37,8 +38,9 @@ def main():
logging.setup(CONF, 'nova')
utils.monkey_patch()
objects.register_all()
gmr_opts.set_defaults(CONF)
gmr.TextGuruMeditation.setup_autorun(version)
gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
LOG.warning('Cells v1 is deprecated in favor of Cells v2 and will be '
'removed in the future.')

View File

@ -23,6 +23,7 @@ import os_vif
from oslo_log import log as logging
from oslo_privsep import priv_context
from oslo_reports import guru_meditation_report as gmr
from oslo_reports import opts as gmr_opts
from nova.cmd import common as cmd_common
from nova.compute import rpcapi as compute_rpcapi
@ -45,10 +46,11 @@ def main():
priv_context.init(root_helper=shlex.split(utils.get_root_helper()))
utils.monkey_patch()
objects.register_all()
gmr_opts.set_defaults(CONF)
# Ensure os-vif objects are registered and plugins loaded
os_vif.initialize()
gmr.TextGuruMeditation.setup_autorun(version)
gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
cmd_common.block_db_access('nova-compute')
objects_base.NovaObject.indirection_api = conductor_rpcapi.ConductorAPI()

View File

@ -19,6 +19,7 @@ import sys
from oslo_concurrency import processutils
from oslo_log import log as logging
from oslo_reports import guru_meditation_report as gmr
from oslo_reports import opts as gmr_opts
import nova.conf
from nova import config
@ -35,9 +36,10 @@ def main():
logging.setup(CONF, "nova")
utils.monkey_patch()
objects.register_all()
gmr_opts.set_defaults(CONF)
objects.Service.enable_min_version_cache()
gmr.TextGuruMeditation.setup_autorun(version)
gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
server = service.Service.create(binary='nova-conductor',
topic=CONF.conductor.topic)

View File

@ -20,6 +20,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 nova import config
from nova.console import rpcapi as console_rpcapi
@ -34,8 +35,9 @@ def main():
config.parse_args(sys.argv)
logging.setup(CONF, "nova")
objects.register_all()
gmr_opts.set_defaults(CONF)
gmr.TextGuruMeditation.setup_autorun(version)
gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
server = service.Service.create(binary='nova-console',
topic=console_rpcapi.RPC_TOPIC)

View File

@ -19,6 +19,7 @@ import sys
from oslo_log import log as logging
from oslo_reports import guru_meditation_report as gmr
from oslo_reports import opts as gmr_opts
import nova.conf
from nova import config
@ -34,8 +35,9 @@ def main():
config.parse_args(sys.argv)
logging.setup(CONF, "nova")
objects.register_all()
gmr_opts.set_defaults(CONF)
gmr.TextGuruMeditation.setup_autorun(version)
gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
server = service.Service.create(binary='nova-consoleauth',
topic=rpcapi.RPC_TOPIC)

View File

@ -20,6 +20,7 @@ import sys
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 nova.cmd import common as cmd_common
from nova.conductor import rpcapi as conductor_rpcapi
@ -47,8 +48,9 @@ def main():
utils.monkey_patch()
objects.register_all()
gmr_opts.set_defaults(CONF)
gmr.TextGuruMeditation.setup_autorun(version)
gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
cmd_common.block_db_access('nova-network')
objects_base.NovaObject.indirection_api = conductor_rpcapi.ConductorAPI()

View File

@ -20,6 +20,7 @@ import sys
from oslo_log import log as logging
from oslo_reports import guru_meditation_report as gmr
from oslo_reports import opts as gmr_opts
import nova.conf
from nova import config
@ -37,9 +38,10 @@ def main():
logging.setup(CONF, "nova")
utils.monkey_patch()
objects.register_all()
gmr_opts.set_defaults(CONF)
objects.Service.enable_min_version_cache()
gmr.TextGuruMeditation.setup_autorun(version)
gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
server = service.Service.create(binary='nova-scheduler',
topic=scheduler_rpcapi.RPC_TOPIC)

View File

@ -19,18 +19,23 @@ import sys
from oslo_log import log as logging
from oslo_reports import guru_meditation_report as gmr
from oslo_reports import opts as gmr_opts
import nova.conf
from nova import config
from nova import service
from nova import version
from nova.vnc import xvp_proxy
CONF = nova.conf.CONF
def main():
config.parse_args(sys.argv)
logging.setup(config.CONF, "nova")
gmr_opts.set_defaults(CONF)
gmr.TextGuruMeditation.setup_autorun(version)
gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
wsgi_server = xvp_proxy.get_wsgi_server()
service.serve(wsgi_server)

View File

@ -0,0 +1,14 @@
---
features:
- |
Configuration options for `oslo.reports`, found in the ``oslo_reports``
group, are now exposed in nova. These include:
- ``log_dir``
- ``file_event_handler``
- ``file_event_handler_interval``
These will allow using a file trigger for the reports, which is
particularly useful for Windows nodes where the default signals are not
available. Also, specifying a log directory will allow the reports to be
generated at a specific location instead of stdout.