diff options
| author | Tushar Patil <tushar.vitthal.patil@gmail.com> | 2011-01-20 16:47:46 -0800 |
|---|---|---|
| committer | Tushar Patil <tushar.vitthal.patil@gmail.com> | 2011-01-20 16:47:46 -0800 |
| commit | edceeb76885a246191315c6a6c76a7e4e89511e5 (patch) | |
| tree | 26bda7b28b556bbf58b3667d2766e273bba85105 /nova | |
| parent | 14edbd55e667b16b8d46c0230b11ccd964f5742f (diff) | |
| download | nova-edceeb76885a246191315c6a6c76a7e4e89511e5.tar.gz nova-edceeb76885a246191315c6a6c76a7e4e89511e5.tar.xz nova-edceeb76885a246191315c6a6c76a7e4e89511e5.zip | |
Fix for LP Bug #699654
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/api/ec2/__init__.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/nova/api/ec2/__init__.py b/nova/api/ec2/__init__.py index 238cb0f38..f251c8d41 100644 --- a/nova/api/ec2/__init__.py +++ b/nova/api/ec2/__init__.py @@ -168,7 +168,7 @@ class Authenticate(wsgi.Middleware): req.path) # Be explicit for what exceptions are 403, the rest bubble as 500 except (exception.NotFound, exception.NotAuthorized) as ex: - LOG.audit(_("Authentication Failure: %s"), str(ex)) + LOG.error(_("Authentication Failure: %s"), ex.args[0]) raise webob.exc.HTTPForbidden() # Authenticated! @@ -310,17 +310,17 @@ class Executor(wsgi.Application): try: result = api_request.invoke(context) except exception.NotFound as ex: - LOG.info(_('NotFound raised: %s'), str(ex), context=context) - return self._error(req, context, type(ex).__name__, str(ex)) + LOG.info(_('NotFound raised: %s'), ex.args[0], context=context) + return self._error(req, context, type(ex).__name__, ex.args[0]) except exception.ApiError as ex: - LOG.exception(_('ApiError raised: %s'), str(ex), context=context) + LOG.exception(_('ApiError raised: %s'), ex.args[0], context=context) if ex.code: - return self._error(req, context, ex.code, str(ex)) + return self._error(req, context, ex.code, ex.args[0]) else: - return self._error(req, context, type(ex).__name__, str(ex)) + return self._error(req, context, type(ex).__name__, ex.args[0]) except Exception as ex: extra = {'environment': req.environ} - LOG.exception(_('Unexpected error raised: %s'), str(ex), + LOG.exception(_('Unexpected error raised: %s'), ex.args[0], extra=extra, context=context) return self._error(req, context, @@ -343,7 +343,8 @@ class Executor(wsgi.Application): '<Response><Errors><Error><Code>%s</Code>' '<Message>%s</Message></Error></Errors>' '<RequestID>%s</RequestID></Response>' % - (code, message, context.request_id)) + (utils.utf8(code), utils.utf8(message), + utils.utf8(context.request_id))) return resp |
