From a390798d4e5956e94060a9c45a1f7be2bdb9ccbd Mon Sep 17 00:00:00 2001 From: Johannes Erdfelt Date: Thu, 31 May 2012 13:13:46 +0000 Subject: Make sure an exception is logged when config file isn't found Fixes bug 1006457 Since exception.ConfigNotFound was derived from exception.NotFound, it would result in a silent 404 error being returned to the client instead of logging a useful error message that a necessary config file was missing and returning a 500 error. Change-Id: I3abefae8d41be4013501ba1731fa49e3c93bde1a --- nova/exception.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/nova/exception.py b/nova/exception.py index 1e1818e7d..3f3988d2d 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -424,10 +424,6 @@ class NotFound(NovaException): code = 404 -class FlagNotSet(NotFound): - message = _("Required flag %(flag)s not set.") - - class VolumeNotFound(NotFound): message = _("Volume %(volume_id)s could not be found.") @@ -941,11 +937,13 @@ class MalformedRequestBody(NovaException): message = _("Malformed message body: %(reason)s") -class ConfigNotFound(NotFound): +# NOTE(johannes): NotFound should only be used when a 404 error is +# appropriate to be returned +class ConfigNotFound(NovaException): message = _("Could not find config at %(path)s") -class PasteAppNotFound(NotFound): +class PasteAppNotFound(NovaException): message = _("Could not load paste app '%(name)s' from %(path)s") -- cgit