Fix typo in config option name

[haproxy_amphora]/active_connection_rety_interval
is renamed to active_connection_retry_interval.

A config option with the typo still exists as a deprecated alias, so it
doesn't break compatibility with old config files.

Change-Id: Iafc479f1628fd3959c3f0ef83edb7a739823fb91
This commit is contained in:
Gregory Thiemonge 2021-12-27 08:20:25 +01:00
parent 27e5b27d31
commit 80acf3bea8
10 changed files with 50 additions and 8 deletions

View File

@ -267,7 +267,7 @@
# be fully up and active. These values are lower than the other values to
# facilitate "fail fast" scenarios like failovers
# active_connection_max_retries = 15
# active_connection_rety_interval = 2
# active_connection_retry_interval = 2
# These "failover" timeouts are used during the failover process to probe
# amphorae that are part of the load balancer being failed over.

View File

@ -354,8 +354,9 @@ haproxy_amphora_opts = [
cfg.IntOpt('active_connection_max_retries',
default=15,
help=_('Retry threshold for connecting to active amphorae.')),
cfg.IntOpt('active_connection_rety_interval',
cfg.IntOpt('active_connection_retry_interval',
default=2,
deprecated_name='active_connection_rety_interval',
help=_('Retry timeout between connection attempts in '
'seconds for active amphora.')),
cfg.IntOpt('failover_connection_max_retries',

View File

@ -550,7 +550,7 @@ class AmphoraFlows(object):
constants.CONN_MAX_RETRIES:
CONF.haproxy_amphora.active_connection_max_retries,
constants.CONN_RETRY_INTERVAL:
CONF.haproxy_amphora.active_connection_rety_interval}
CONF.haproxy_amphora.active_connection_retry_interval}
# Listeners update needs to be run on all amphora to update
# their peer configurations. So parallelize this with an

View File

@ -391,7 +391,7 @@ class LoadBalancerFlows(object):
constants.CONN_MAX_RETRIES:
CONF.haproxy_amphora.active_connection_max_retries,
constants.CONN_RETRY_INTERVAL:
CONF.haproxy_amphora.active_connection_rety_interval}
CONF.haproxy_amphora.active_connection_retry_interval}
if failed_amp:
if failed_amp.role in (constants.ROLE_MASTER,

View File

@ -523,7 +523,7 @@ class AmphoraFlows(object):
constants.CONN_MAX_RETRIES:
CONF.haproxy_amphora.active_connection_max_retries,
constants.CONN_RETRY_INTERVAL:
CONF.haproxy_amphora.active_connection_rety_interval}
CONF.haproxy_amphora.active_connection_retry_interval}
# Listeners update needs to be run on all amphora to update
# their peer configurations. So parallelize this with an

View File

@ -375,7 +375,7 @@ class LoadBalancerFlows(object):
constants.CONN_MAX_RETRIES:
CONF.haproxy_amphora.active_connection_max_retries,
constants.CONN_RETRY_INTERVAL:
CONF.haproxy_amphora.active_connection_rety_interval}
CONF.haproxy_amphora.active_connection_retry_interval}
if failed_amp:
failed_amp_role = failed_amp.get(constants.ROLE)

View File

@ -12,6 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import tempfile
from oslo_config import cfg
from oslo_config import fixture as oslo_fixture
@ -49,3 +51,30 @@ class TestConfig(base.TestCase):
self.assertRaises(
ValueError, conf.config, group="certificates",
server_certs_key_passphrase="insecure-key-do-not-u$e-this-key")
def test_active_connection_retry_interval(self):
conf = self.useFixture(oslo_fixture.Config(config.cfg.CONF))
# Test new name
with tempfile.NamedTemporaryFile(mode='w', delete=True) as tmp:
tmp.write("[haproxy_amphora]\n"
"active_connection_retry_interval=4\n")
tmp.flush()
conf.set_config_files([tmp.name])
self.assertEqual(
4,
conf.conf.haproxy_amphora.active_connection_retry_interval)
# Test deprecated name
with tempfile.NamedTemporaryFile(mode='w', delete=True) as tmp:
tmp.write("[haproxy_amphora]\n"
"active_connection_rety_interval=3\n")
tmp.flush()
conf.set_config_files([tmp.name])
self.assertEqual(
3,
conf.conf.haproxy_amphora.active_connection_retry_interval)

View File

@ -74,7 +74,7 @@ class TestAmphoraDriverTasks(base.TestCase):
conf.config(group="haproxy_amphora",
active_connection_max_retries=CONN_MAX_RETRIES)
conf.config(group="haproxy_amphora",
active_connection_rety_interval=CONN_RETRY_INTERVAL)
active_connection_retry_interval=CONN_RETRY_INTERVAL)
conf.config(group="controller_worker",
loadbalancer_topology=constants.TOPOLOGY_SINGLE)
self.timeout_dict = {constants.REQ_CONN_TIMEOUT: 1,

View File

@ -79,7 +79,7 @@ class TestAmphoraDriverTasks(base.TestCase):
conf.config(group="haproxy_amphora",
active_connection_max_retries=CONN_MAX_RETRIES)
conf.config(group="haproxy_amphora",
active_connection_rety_interval=CONN_RETRY_INTERVAL)
active_connection_retry_interval=CONN_RETRY_INTERVAL)
conf.config(group="controller_worker",
loadbalancer_topology=constants.TOPOLOGY_SINGLE)
self.timeout_dict = {constants.REQ_CONN_TIMEOUT: 1,

View File

@ -0,0 +1,12 @@
---
upgrade:
- |
The ``[haproxy_amphora].active_connection_rety_interval`` configuration
option has been renamed to
``[haproxy_amphora].active_connection_retry_interval``. An alias for the old
name is in place to maintain compatibility with old configuration files.
fixes:
- |
The ``[haproxy_amphora].active_connection_rety_interval`` configuration
option has been renamed to
``[haproxy_amphora].active_connection_retry_interval``.