summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2011-05-18 14:23:09 -0700
committerVishvananda Ishaya <vishvananda@gmail.com>2011-05-18 14:23:09 -0700
commit38ba122d9eb67c699ea0c10eab5961c3b4c25d81 (patch)
tree8d3ff80a8a52739bf59b8b242a708af976e4fc71 /nova/api
parentef42fa95197e7b0f73e04322456bbbdedaf3e2b3 (diff)
use a manual 500 with error text instead of traceback for failure
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/ec2/metadatarequesthandler.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/nova/api/ec2/metadatarequesthandler.py b/nova/api/ec2/metadatarequesthandler.py
index 481e34e12..720f264a4 100644
--- a/nova/api/ec2/metadatarequesthandler.py
+++ b/nova/api/ec2/metadatarequesthandler.py
@@ -23,6 +23,7 @@ import webob.exc
from nova import log as logging
from nova import flags
+from nova import utils
from nova import wsgi
from nova.api.ec2 import cloud
@@ -75,7 +76,12 @@ class MetadataRequestHandler(wsgi.Application):
meta_data = cc.get_metadata(remote_address)
except Exception:
LOG.exception(_('Failed to get metadata for ip: %s'), remote_address)
- raise
+ resp = webob.Response()
+ resp.status = 500
+ message = _('An unknown error has occurred. '
+ 'Please try your request again.')
+ resp.body = str(utils.utf8(message))
+ return resp
if meta_data is None:
LOG.error(_('Failed to get metadata for ip: %s'), remote_address)
raise webob.exc.HTTPNotFound()