From 885efbcaad0ed6ae5ab362ea13eb7dee3abff2ae Mon Sep 17 00:00:00 2001 From: Christopher Yeoh Date: Mon, 7 Apr 2014 22:42:39 +0930 Subject: [PATCH] Adds missing expected_errors for V3 API multinic extension The V3 API multinic extension is missing the expected errors decorators which means that unexpected internal Nova exceptions are not caught correctly. This patch adds the expected error decorators. Change-Id: I99311275197bb5123079c8910855386252028dec Closes-Bug: 1303781 --- nova/api/openstack/compute/plugins/v3/multinic.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nova/api/openstack/compute/plugins/v3/multinic.py b/nova/api/openstack/compute/plugins/v3/multinic.py index dcba72a3a0..cb6aee2224 100644 --- a/nova/api/openstack/compute/plugins/v3/multinic.py +++ b/nova/api/openstack/compute/plugins/v3/multinic.py @@ -39,6 +39,7 @@ class MultinicController(wsgi.Controller): self.compute_api = compute.API() @wsgi.action('add_fixed_ip') + @extensions.expected_errors(404) @validation.schema(multinic.add_fixed_ip) def _add_fixed_ip(self, req, id, body): """Adds an IP on a given network to an instance.""" @@ -52,6 +53,7 @@ class MultinicController(wsgi.Controller): return webob.Response(status_int=202) @wsgi.action('remove_fixed_ip') + @extensions.expected_errors((400, 404)) @validation.schema(multinic.remove_fixed_ip) def _remove_fixed_ip(self, req, id, body): """Removes an IP from an instance."""