Browse Source

Merge "Fix the amphora noop driver" into stable/queens

stable/queens
Zuul 2 months ago
committed by Gerrit Code Review
parent
commit
299c54a5de
3 changed files with 13 additions and 7 deletions
  1. +4
    -2
      octavia/amphorae/drivers/haproxy/rest_api_driver.py
  2. +7
    -4
      octavia/amphorae/drivers/noop_driver/driver.py
  3. +2
    -1
      octavia/tests/unit/amphorae/drivers/test_noop_amphoraloadbalancer_driver.py

+ 4
- 2
octavia/amphorae/drivers/haproxy/rest_api_driver.py View File

@@ -64,8 +64,10 @@ class HaproxyAmphoraLoadBalancerDriver(

:param listeners: List of listeners to update.
:type listener: list
:param amphora_id: The ID of the amphora to update
:type amphora_id: string
:param amphora_index: The index of the amphora to update
:type amphora_index: integer
:param amphorae: List of amphorae
:type amphorae: list
:param timeout_dict: Dictionary of timeout values for calls to the
amphora. May contain: req_conn_timeout,
req_read_timeout, conn_max_retries,


+ 7
- 4
octavia/amphorae/drivers/noop_driver/driver.py View File

@@ -37,7 +37,9 @@ class NoopManager(object):
super(NoopManager, self).__init__()
self.amphoraconfig = {}

def update_amphora_listeners(self, listeners, amphora_id, timeout_dict):
def update_amphora_listeners(self, listeners, amphora_index,
amphorae, timeout_dict):
amphora_id = amphorae[amphora_index].id
for listener in listeners:
LOG.debug("Amphora noop driver update_amphora_listeners, "
"listener %s, amphora %s, timeouts %s", listener.id,
@@ -114,10 +116,11 @@ class NoopAmphoraLoadBalancerDriver(
super(NoopAmphoraLoadBalancerDriver, self).__init__()
self.driver = NoopManager()

def update_amphora_listeners(self, listeners, amphora_id, timeout_dict):
def update_amphora_listeners(self, listeners, amphora_index,
amphorae, timeout_dict):

self.driver.update_amphora_listeners(listeners, amphora_id,
timeout_dict)
self.driver.update_amphora_listeners(listeners, amphora_index,
amphorae, timeout_dict)

def update(self, listener, vip):



+ 2
- 1
octavia/tests/unit/amphorae/drivers/test_noop_amphoraloadbalancer_driver.py View File

@@ -69,7 +69,8 @@ class TestNoopAmphoraLoadBalancerDriver(base.TestCase):
constants.CONN_RETRY_INTERVAL: 4}

def test_update_amphora_listeners(self):
self.driver.update_amphora_listeners([self.listener], self.amphora.id,
amphorae = [self.amphora]
self.driver.update_amphora_listeners([self.listener], 0, amphorae,
self.timeout_dict)
self.assertEqual((self.listener, self.amphora.id, self.timeout_dict,
'update_amp'),


Loading…
Cancel
Save