drop reraise from the controller

Using reraise is less explicit in both code behavior and in content of
the logging when the original exception is dropped.

Change-Id: I4e7122606b1de17965b315e67de1e5655582819b
Signed-off-by: Antoni Segura Puimedon <celebdor@gmail.com>
This commit is contained in:
Antoni Segura Puimedon 2018-09-27 09:41:41 +02:00
parent ef00f3480b
commit 5fb232a63c
1 changed files with 11 additions and 2 deletions

View File

@ -14,14 +14,16 @@
# under the License.
import random
import six
import sys
import time
import traceback
import requests
from neutronclient.common import exceptions as n_exc
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
from oslo_utils import timeutils
from kuryr_kubernetes import clients
@ -411,8 +413,15 @@ class LBaaSv2Driver(base.LBaaSDriver):
pool.id = response['pool']['id']
return pool
except n_exc.StateInvalidClient:
with excutils.save_and_reraise_exception():
(type_, value, tb) = sys.exc_info()
try:
self._cleanup_bogus_pool(lbaas, pool, lb_algorithm)
except Exception:
LOG.error('Pool creation traceback: %s',
traceback.format_exception(type_, value, tb))
raise
else:
six.reraise(type_, value, tb)
def _cleanup_bogus_pool(self, lbaas, pool, lb_algorithm):
# REVISIT(ivc): LBaaSv2 creates pool object despite raising an