diff --git a/nova/api/openstack/placement/wsgi.py b/nova/api/openstack/placement/wsgi.py index 599517e4633a..5f1c268d2ab4 100644 --- a/nova/api/openstack/placement/wsgi.py +++ b/nova/api/openstack/placement/wsgi.py @@ -19,7 +19,6 @@ import os import os.path from oslo_log import log as logging -from oslo_service import _options as service_opts from nova.api.openstack.placement import deploy from nova import conf @@ -56,11 +55,7 @@ def init_application(): # initialize the logging system setup_logging(conf.CONF) - # dump conf at debug (log_options option comes from oslo.service) - # FIXME(mriedem): This is gross but we don't have a public hook into - # oslo.service to register these options, so we are doing it manually for - # now; remove this when we have a hook method into oslo.service. - conf.CONF.register_opts(service_opts.service_opts) + # dump conf at debug if log_options if conf.CONF.log_options: conf.CONF.log_opt_values( logging.getLogger(__name__), diff --git a/nova/conf/placement.py b/nova/conf/placement.py index fd68dc13d193..7d03a72785e1 100644 --- a/nova/conf/placement.py +++ b/nova/conf/placement.py @@ -47,9 +47,22 @@ is determined. ] +# Duplicate log_options from oslo_service so that we don't have to import +# that package into placement. +# NOTE(cdent): Doing so ends up requiring eventlet and other unnecessary +# packages for just this one setting. +service_opts = [ + cfg.BoolOpt('log_options', + default=True, + help='Enables or disables logging values of all registered ' + 'options when starting a service (at DEBUG level).'), +] + + def register_opts(conf): conf.register_group(placement_group) conf.register_opts(placement_opts, group=placement_group) + conf.register_opts(service_opts) confutils.register_ksa_opts(conf, placement_group, DEFAULT_SERVICE_TYPE)