Merge "Adding improved logging to amphora rest driver"

changes/26/339826/18
Jenkins 6 years ago committed by Gerrit Code Review
commit 78e28f880b
  1. 8
      octavia/amphorae/drivers/haproxy/rest_api_driver.py

@ -31,7 +31,7 @@ from octavia.common.config import cfg
from octavia.common import constants
from octavia.common.jinja.haproxy import jinja_cfg
from octavia.common.tls_utils import cert_parser
from octavia.i18n import _LW
from octavia.i18n import _LE, _LW
LOG = logging.getLogger(__name__)
API_VERSION = constants.API_VERSION
@ -244,9 +244,15 @@ class AmphoraAPIClient(object):
LOG.warning(_LW("Could not connect to instance. Retrying."))
time.sleep(CONF.haproxy_amphora.connection_retry_interval)
if a == CONF.haproxy_amphora.connection_max_retries - 1:
LOG.error(_LE("Timed out connecting to the amphora."))
raise driver_except.TimeOutException()
else:
LOG.debug(
"Connected to amphora. Response: {resp}".format(resp=r))
return r
LOG.error(_LE("Connection retries (currently set to %s) "
"exhausted. The amphora is unavailable."),
CONF.haproxy_amphora.connection_max_retries)
raise driver_except.UnavailableException()
def upload_config(self, amp, listener_id, config):

Loading…
Cancel
Save