from nova.conf import crypto
from nova.conf import database
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
crypto.register_opts(CONF)
database.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)
+++ /dev/null
-# 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,
- deprecated_for_removal=True,
- deprecated_since="14.0.0",
- deprecated_reason="This is only used for internal testing.",
- help="""
-When set to true, this option enables validation of exception
-message format.
-
-This option is used to detect errors in NovaException class when it formats
-error messages. If True, raise an exception; if False, use the unformatted
-message.
-""")
-]
-
-
-def register_opts(conf):
- conf.register_opts(exc_log_opts)
-
-
-def list_opts():
- return {'DEFAULT': exc_log_opts}
"""
-import sys
-
from oslo_log import log as logging
import six
import webob.exc
message = self.msg_fmt % kwargs
except Exception:
- exc_info = sys.exc_info()
# kwargs doesn't match a variable in the message
# log the issue and the kwargs
LOG.exception(_LE('Exception in string format operation'))
for name, value in six.iteritems(kwargs):
LOG.error("%s: %s" % (name, value)) # noqa
- if CONF.fatal_exception_format_errors:
- six.reraise(*exc_info)
- else:
- # at least get the core message out if something happened
- message = self.msg_fmt
+ message = self.msg_fmt
self.message = message
super(NovaException, self).__init__(message)
self.conf.set_default('sqlite_synchronous', False, group='database')
self.conf.set_default('sqlite_synchronous', False,
group='api_database')
- self.conf.set_default('fatal_exception_format_errors', True)
# TODO(sdague): this makes our project_id match 'fake' as well.
# We should fix the tests to use real
# UUIDs then drop this work around.
def __unicode__(self):
return u"print the whole trace"
- self.flags(fatal_exception_format_errors=False)
exc = FakeNovaException_Remote(lame_arg='lame')
self.assertEqual("some message %(somearg)s", exc.format_message())
def test_exceptions_raise(self):
# NOTE(dprince): disable format errors since we are not passing kwargs
- self.flags(fatal_exception_format_errors=False)
for name in dir(exception):
exc = getattr(exception, name)
if isinstance(exc, type):
--- /dev/null
+---
+upgrade:
+ - |
+ ``fatal_exception_format_errors`` configuration option has been removed,
+ as it was only used for internal testing.
\ No newline at end of file