Add logging filter for AmpConnectionRetry exception
We do not need to log exception info about AmpConnectionRetry as this is expected exception, which enables retry process for AmphoraComputeConnectivityWait task. Change-Id: Ib40345fc441cf916c3542bfddbf8ac812159cd2e Story: 2005072
This commit is contained in:
parent
47e0ef31bc
commit
038b2d5d6c
|
@ -21,6 +21,7 @@ from sqlalchemy.orm import exc as db_exceptions
|
|||
from taskflow.listeners import logging as tf_logging
|
||||
import tenacity
|
||||
|
||||
from octavia.amphorae.driver_exceptions import exceptions
|
||||
from octavia.api.drivers import utils as provider_utils
|
||||
from octavia.common import base_taskflow
|
||||
from octavia.common import constants
|
||||
|
@ -44,6 +45,17 @@ RETRY_BACKOFF = 1
|
|||
RETRY_MAX = 5
|
||||
|
||||
|
||||
# We do not need to log retry exception information. Warning "Could not connect
|
||||
# to instance" will be logged as usual.
|
||||
def retryMaskFilter(record):
|
||||
if record.exc_info is not None and isinstance(
|
||||
record.exc_info[1], exceptions.AmpConnectionRetry):
|
||||
return False
|
||||
return True
|
||||
|
||||
LOG.logger.addFilter(retryMaskFilter)
|
||||
|
||||
|
||||
def _is_provisioning_status_pending_update(lb_obj):
|
||||
return not lb_obj.provisioning_status == constants.PENDING_UPDATE
|
||||
|
||||
|
|
Loading…
Reference in New Issue