diff options
| author | Boris Pavlovic <boris@pavlovic.me> | 2013-06-14 17:53:53 +0400 |
|---|---|---|
| committer | Boris Pavlovic <boris@pavlovic.me> | 2013-06-22 00:09:22 +0400 |
| commit | 616098dcd36b20e01d38898b8942003df664e6ac (patch) | |
| tree | 0000b9be01d6c6aa565a687c5490def7075bb0d4 /nova/api | |
| parent | d147af21db2db77f578e527883cf2c68abc56496 (diff) | |
| download | nova-616098dcd36b20e01d38898b8942003df664e6ac.tar.gz nova-616098dcd36b20e01d38898b8942003df664e6ac.tar.xz nova-616098dcd36b20e01d38898b8942003df664e6ac.zip | |
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: Ia375ecef9f16bda65d5146d14ed4b37a988abb0c
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/contrib/coverage_ext.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nova/api/openstack/compute/contrib/coverage_ext.py b/nova/api/openstack/compute/contrib/coverage_ext.py index 154699470..578e2e79d 100644 --- a/nova/api/openstack/compute/contrib/coverage_ext.py +++ b/nova/api/openstack/compute/contrib/coverage_ext.py @@ -134,11 +134,12 @@ class CoverageController(object): # doesn't resolve to 127.0.0.1. Currently backdoors only open on # loopback so this is for covering the common single host use case except socket.error as e: + exc_info = sys.exc_info() if 'ECONNREFUSED' in e and service['host'] == self.host: service['telnet'] = telnetlib.Telnet('127.0.0.1', service['port']) else: - raise e + raise exc_info[0], exc_info[1], exc_info[2] self.services.append(service) self._start_coverage_telnet(service['telnet'], service['service']) |
