summaryrefslogtreecommitdiff
path: root/nova/api
diff options
context:
space:
mode:
authorChris Yeoh <cyeoh@au1.ibm.com>2014-06-26 16:34:57 +0930
committerChris Yeoh <cyeoh@au1.ibm.com>2014-06-26 17:15:54 +0930
commite06cd36bf8145b3b75ae866d323f231a1ab59c95 (patch)
tree6bb23d766e0e58d5ffb51178ac8eba5e490f4434 /nova/api
parent383caeb88901d862d43881f277898d48b9a83a53 (diff)
downloadnova-e06cd36bf8145b3b75ae866d323f231a1ab59c95.tar.gz
Fix exception raised when a requested console type is disabled
The get_{vnc/rdp/spice}_console calls should raise ConsoleTypeUnavailable not ConsoleTypeInvalid when the corresponding console is disabled (rather than supplying an invalid subtype). Also removes exception handling of ConsoleTypeInvalid from the os-remote-consoles V3 API plugin as the schema validation ensures the input passed to nova internals is valid. Change-Id: Ia444775ff6ec1d869d810bc689914efb8cd233a4
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/plugins/v3/remote_consoles.py6
1 files changed, 0 insertions, 6 deletions
diff --git a/nova/api/openstack/compute/plugins/v3/remote_consoles.py b/nova/api/openstack/compute/plugins/v3/remote_consoles.py
index d57c3a8434..7d8310f38c 100644
--- a/nova/api/openstack/compute/plugins/v3/remote_consoles.py
+++ b/nova/api/openstack/compute/plugins/v3/remote_consoles.py
@@ -50,8 +50,6 @@ class RemoteConsolesController(wsgi.Controller):
output = self.compute_api.get_vnc_console(context,
instance,
console_type)
- except exception.ConsoleTypeInvalid as e:
- raise webob.exc.HTTPBadRequest(explanation=e.format_message())
except exception.ConsoleTypeUnavailable as e:
raise webob.exc.HTTPBadRequest(explanation=e.format_message())
except exception.InstanceNotFound as e:
@@ -81,8 +79,6 @@ class RemoteConsolesController(wsgi.Controller):
output = self.compute_api.get_spice_console(context,
instance,
console_type)
- except exception.ConsoleTypeInvalid as e:
- raise webob.exc.HTTPBadRequest(explanation=e.format_message())
except exception.ConsoleTypeUnavailable as e:
raise webob.exc.HTTPBadRequest(explanation=e.format_message())
except exception.InstanceNotFound as e:
@@ -115,8 +111,6 @@ class RemoteConsolesController(wsgi.Controller):
output = self.compute_api.get_rdp_console(context,
instance,
console_type)
- except exception.ConsoleTypeInvalid as e:
- raise webob.exc.HTTPBadRequest(explanation=e.format_message())
except exception.ConsoleTypeUnavailable as e:
raise webob.exc.HTTPBadRequest(explanation=e.format_message())
except exception.InstanceNotFound as e: