diff --git a/nova/conf/__init__.py b/nova/conf/__init__.py index 943f9e72bf6d..09286959c3f7 100644 --- a/nova/conf/__init__.py +++ b/nova/conf/__init__.py @@ -40,6 +40,7 @@ from nova.conf import crypto from nova.conf import database # from nova.conf import disk from nova.conf import ephemeral_storage +from nova.conf import exceptions from nova.conf import flavors from nova.conf import floating_ips from nova.conf import glance @@ -114,6 +115,7 @@ crypto.register_opts(CONF) database.register_opts(CONF) # disk.register_opts(CONF) ephemeral_storage.register_opts(CONF) +exceptions.register_opts(CONF) floating_ips.register_opts(CONF) flavors.register_opts(CONF) glance.register_opts(CONF) diff --git a/nova/conf/exceptions.py b/nova/conf/exceptions.py new file mode 100644 index 000000000000..cfdb176e6f09 --- /dev/null +++ b/nova/conf/exceptions.py @@ -0,0 +1,30 @@ +# Copyright 2016 OpenStack Foundation +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from oslo_config import cfg + +exc_log_opts = [ + cfg.BoolOpt('fatal_exception_format_errors', + default=False, + help='Make exception message format errors fatal'), +] + + +def register_opts(conf): + conf.register_opts(exc_log_opts) + + +def list_opts(): + return {'DEFAULT': exc_log_opts} diff --git a/nova/exception.py b/nova/exception.py index d10561ffb1e7..f9a60fc43acb 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -26,26 +26,20 @@ import functools import inspect import sys -from oslo_config import cfg from oslo_log import log as logging from oslo_utils import excutils import six import webob.exc from webob import util as woutil +import nova.conf from nova.i18n import _, _LE from nova import safe_utils LOG = logging.getLogger(__name__) -exc_log_opts = [ - cfg.BoolOpt('fatal_exception_format_errors', - default=False, - help='Make exception message format errors fatal'), -] -CONF = cfg.CONF -CONF.register_opts(exc_log_opts) +CONF = nova.conf.CONF class ConvertedException(webob.exc.WSGIHTTPException): diff --git a/nova/opts.py b/nova/opts.py index d636a76f9074..042091818995 100644 --- a/nova/opts.py +++ b/nova/opts.py @@ -30,7 +30,6 @@ def list_opts(): return [ ('DEFAULT', itertools.chain( - nova.exception.exc_log_opts, nova.volume._volume_opts, )), ]