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
This commit is contained in:
@@ -61,7 +61,7 @@ class ScalityDriverTestCase(test.TestCase):
|
||||
os.makedirs(path)
|
||||
except OSError as e:
|
||||
if e.errno != errno.EEXIST:
|
||||
raise e
|
||||
raise
|
||||
|
||||
def _create_fake_config(self):
|
||||
open(self.TEST_CONFIG, "w+").close()
|
||||
@@ -75,7 +75,7 @@ class ScalityDriverTestCase(test.TestCase):
|
||||
os.unlink(self.TEST_CONFIG)
|
||||
except OSError as e:
|
||||
if e.errno != errno.ENOENT:
|
||||
raise e
|
||||
raise
|
||||
|
||||
def _configure_driver(self):
|
||||
scality.CONF.scality_sofs_config = self.TEST_CONFIG
|
||||
|
||||
Reference in New Issue
Block a user