]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Do not raise NEW exceptions
authorSergey Vilgelm <svilgelm@mirantis.com>
Mon, 24 Jun 2013 11:19:50 +0000 (15:19 +0400)
committerSergey Vilgelm <svilgelm@mirantis.com>
Tue, 25 Jun 2013 13:25:07 +0000 (17:25 +0400)
commit33f6d78c3a0f3e3c34e8b91a8dffb1391f7b46b6
treed2b22e0d5cafa49c9d61b2fd2313e409d16ddf2e
parent1bf8bfad290eeca17c666ca19d5a032e6fefe298
Do not raise NEW exceptions

Raising NEW exception is bad practice, because we lose TraceBack.
So all places like:

except SomeException as e:
    raise e

should be replaced by

except SomeException:
    raise

If we are doing some other actions before reraising we should
store information about exception then do all actions and then
reraise it. This is caused by eventlet bug. It lost information
about exception if it switch threads.

fixes bug 1191730
Change-Id: Ic2be96e9f03d2ca46d060caf6f6f7f713a1d6b82
12 files changed:
HACKING.rst
cinder/exception.py
cinder/tests/test_netapp_nfs.py
cinder/tests/test_scality.py
cinder/tests/test_storwize_svc.py
cinder/transfer/api.py
cinder/volume/drivers/hds/hds.py
cinder/volume/drivers/netapp/iscsi.py
cinder/volume/drivers/netapp/nfs.py
cinder/volume/drivers/san/hp/hp_3par_common.py
cinder/volume/drivers/san/san.py
cinder/volume/drivers/scality.py