diff options
| author | Vishvananda Ishaya <vishvananda@gmail.com> | 2011-05-18 14:15:36 -0700 |
|---|---|---|
| committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2011-05-18 14:15:36 -0700 |
| commit | ef42fa95197e7b0f73e04322456bbbdedaf3e2b3 (patch) | |
| tree | 0f403c0debe4bbd9846de3f7fdcdb6d8cfb23b86 | |
| parent | 92db39bdb439f693ed59626d8c58f03e470d31f6 (diff) | |
log any exceptions that get thrown trying to retrieve metadata
| -rw-r--r-- | nova/api/ec2/metadatarequesthandler.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/nova/api/ec2/metadatarequesthandler.py b/nova/api/ec2/metadatarequesthandler.py index 28f99b0ef..481e34e12 100644 --- a/nova/api/ec2/metadatarequesthandler.py +++ b/nova/api/ec2/metadatarequesthandler.py @@ -71,7 +71,11 @@ class MetadataRequestHandler(wsgi.Application): remote_address = req.remote_addr if FLAGS.use_forwarded_for: remote_address = req.headers.get('X-Forwarded-For', remote_address) - meta_data = cc.get_metadata(remote_address) + try: + meta_data = cc.get_metadata(remote_address) + except Exception: + LOG.exception(_('Failed to get metadata for ip: %s'), remote_address) + raise if meta_data is None: LOG.error(_('Failed to get metadata for ip: %s'), remote_address) raise webob.exc.HTTPNotFound() |
