From a02b2d77d3bd40954c9c8dda680e2f7ce3e0327e Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Wed, 13 Mar 2013 15:24:05 -0400 Subject: Don't log traceback on expected console error. When requesting a console before an instance is read (while still building) we will get an InstanceNotReady exception. This exception is raised in the compute manager. The explanation in the exception will include the traceback from the manager side. If we use this as the explanation, we end up with a traceback in the API log, even though it's just an INFO log message. Use a more basic explanation, which is accuately more consistent with other cases of raising HTTP exceptions, which doesn't include a traceback. Fix bug 1154327. Change-Id: Idca443165983289a0df40970f68f95d5550ce72a --- nova/api/openstack/compute/contrib/consoles.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nova/api') diff --git a/nova/api/openstack/compute/contrib/consoles.py b/nova/api/openstack/compute/contrib/consoles.py index 264f0b270..0431a0694 100644 --- a/nova/api/openstack/compute/contrib/consoles.py +++ b/nova/api/openstack/compute/contrib/consoles.py @@ -49,7 +49,8 @@ class ConsolesController(wsgi.Controller): except exception.InstanceNotFound as e: raise webob.exc.HTTPNotFound(explanation=unicode(e)) except exception.InstanceNotReady as e: - raise webob.exc.HTTPConflict(explanation=unicode(e)) + raise webob.exc.HTTPConflict( + explanation=_('Instance not yet ready')) return {'console': {'type': console_type, 'url': output['url']}} -- cgit