Merge "Adding improved logging to amphora rest driver"

This commit is contained in:
Jenkins 2016-07-16 04:39:42 +00:00 committed by Gerrit Code Review
commit 78e28f880b
1 changed files with 7 additions and 1 deletions

View File

@ -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):