Don't add exception instance in LOG.exception

LOG.exception will print out the full stacktrace, that's enough.
We should only record meaningful message.

merged from I8b5c581717e6b78c11c46e226463927450c9f287

Change-Id: I49865d558ff5feda2d6a803741fbee18064b2aec
This commit is contained in:
Andrey Pavlov 2015-04-02 12:26:28 +03:00
parent 1cdaf9fe00
commit e1e116e420
3 changed files with 8 additions and 8 deletions

View File

@ -73,8 +73,8 @@ class FaultWrapper(wsgi.Middleware):
def __call__(self, req):
try:
return req.get_response(self.application)
except Exception as ex:
LOG.exception(_("FaultWrapper: %s"), unicode(ex))
except Exception:
LOG.exception(_("FaultWrapper cathes error"))
return faults.Fault(webob.exc.HTTPInternalServerError())
@ -235,8 +235,8 @@ class EC2KeystoneAuth(wsgi.Middleware):
project_name = result['access']['token']['tenant'].get('name')
roles = [role['name'] for role
in result['access']['user']['roles']]
except (AttributeError, KeyError) as e:
LOG.exception(_("Keystone failure: %s") % e)
except (AttributeError, KeyError):
LOG.exception(_("Keystone failure"))
msg = _("Failure communicating with keystone")
return faults.ec2_error_response(request_id, "AuthFailure", msg,
status=400)

View File

@ -347,9 +347,9 @@ class EC2TestCase(base.BaseTestCase):
**kw_args),
str((tb[0], tb[1], tb[2]))))
cls.cleanUpItem(function, pos_args, kw_args)
except BaseException as exc:
except BaseException:
fail_count += 1
LOG.exception(exc)
LOG.exception('Failure in cleanup')
finally:
del trash_bin[key]
return fail_count

View File

@ -283,8 +283,8 @@ class EC2_EBSInstanceAttaching(base.EC2TestCase):
try:
cls.cleanUpItem(cls.client.DeleteVolume, [],
{'VolumeId': volume_id})
except BaseException as exc:
LOG.exception(exc)
except BaseException:
LOG.exception('EBSInstanceAttaching.tearDownClass failure')
def _test_attaching(self, volume_id, device_name, device_prefix,
new_device_name_letter):