From 051cf0d756d9a9e1d0a5ea1169fa97d89b7885bc Mon Sep 17 00:00:00 2001 From: Andrew Laski Date: Wed, 1 May 2013 21:30:52 -0400 Subject: Call format_message on InstanceTypeNotFound exception Put the exception message from InstanceTypeNotFound into the HTTPBadRequest rather than the exception itself. Prevents a Circular reference error during serialization later. Bug 1175414 Change-Id: I4811e727311af670cd964a6d16ac5fce0fe3186e --- nova/api/openstack/compute/servers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nova/api') diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py index bc4ba67df..94912da97 100644 --- a/nova/api/openstack/compute/servers.py +++ b/nova/api/openstack/compute/servers.py @@ -903,7 +903,7 @@ class Controller(wsgi.Controller): except exception.InstanceTypeMemoryTooSmall as error: raise exc.HTTPBadRequest(explanation=error.format_message()) except exception.InstanceTypeNotFound as error: - raise exc.HTTPBadRequest(explanation=error) + raise exc.HTTPBadRequest(explanation=error.format_message()) except exception.InstanceTypeDiskTooSmall as error: raise exc.HTTPBadRequest(explanation=error.format_message()) except exception.InvalidMetadata as error: -- cgit