summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-05-22 14:45:48 +0000
committerGerrit Code Review <review@openstack.org>2013-05-22 14:45:48 +0000
commit05be719ec76adf60a151b56d695c59fd832cb22b (patch)
tree748bdee48399176b284a8bf02444c345157269b1 /nova/api
parent719ec4725eb7ae458810cbd2be0eb4a2cb5edf9d (diff)
parent8eede5e9814f3305e0bb66eeb93623ba25b16e9a (diff)
Merge "Catch InstanceNotFound in instance_actions GET"
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/contrib/instance_actions.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/nova/api/openstack/compute/contrib/instance_actions.py b/nova/api/openstack/compute/contrib/instance_actions.py
index 4eaa9a1ee..3b15de2ba 100644
--- a/nova/api/openstack/compute/contrib/instance_actions.py
+++ b/nova/api/openstack/compute/contrib/instance_actions.py
@@ -19,6 +19,7 @@ from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.api.openstack import xmlutil
from nova import compute
+from nova import exception
authorize_actions = extensions.extension_authorizer('compute',
'instance_actions')
@@ -84,7 +85,10 @@ class InstanceActionsController(wsgi.Controller):
def index(self, req, server_id):
"""Returns the list of actions recorded for a given instance."""
context = req.environ["nova.context"]
- instance = self.compute_api.get(context, server_id)
+ try:
+ instance = self.compute_api.get(context, server_id)
+ except exception.InstanceNotFound as err:
+ raise exc.HTTPNotFound(explanation=err.format_message())
authorize_actions(context, target=instance)
actions_raw = self.action_api.actions_get(context, instance)
actions = [self._format_action(action) for action in actions_raw]