Browse Source

Fix missing params in amphora base and noop driver

Running amphora failover against the amphora noop driver was raising a
TypeError (reload() takes from 2 to 3 positional arguments but 4 were
given).

Change-Id: I64172d6995959cf377364584ad9a2395f9ec0605
changes/31/737731/2
Carlos Goncalves 2 weeks ago
parent
commit
41c628a084
2 changed files with 24 additions and 12 deletions
  1. +12
    -2
      octavia/amphorae/drivers/driver_base.py
  2. +12
    -10
      octavia/amphorae/drivers/noop_driver/driver.py

+ 12
- 2
octavia/amphorae/drivers/driver_base.py View File

@@ -51,13 +51,18 @@ class AmphoraLoadBalancerDriver(object, metaclass=abc.ABCMeta):
"""

@abc.abstractmethod
def start(self, loadbalancer, amphora):
def start(self, loadbalancer, amphora, timeout_dict=None):
"""Start the listeners on the amphora.

:param loadbalancer: loadbalancer object to start listeners
:type loadbalancer: octavia.db.models.LoadBalancer
:param amphora: Amphora to start. If None, start on all amphora
:type amphora: octavia.db.models.Amphora
:param timeout_dict: Dictionary of timeout values for calls to the
amphora. May contain: req_conn_timeout,
req_read_timeout, conn_max_retries,
conn_retry_interval
:type timeout_dict: dict
:returns: return a value list (listener, vip, status flag--enable)

At this moment, we just build the basic structure for testing, will
@@ -65,13 +70,18 @@ class AmphoraLoadBalancerDriver(object, metaclass=abc.ABCMeta):
"""

@abc.abstractmethod
def reload(self, loadbalancer, amphora):
def reload(self, loadbalancer, amphora, timeout_dict=None):
"""Reload the listeners on the amphora.

:param loadbalancer: loadbalancer object to reload listeners
:type loadbalancer: octavia.db.models.LoadBalancer
:param amphora: Amphora to start. If None, reload on all amphora
:type amphora: octavia.db.models.Amphora
:param timeout_dict: Dictionary of timeout values for calls to the
amphora. May contain: req_conn_timeout,
req_read_timeout, conn_max_retries,
conn_retry_interval
:type timeout_dict: dict
:returns: return a value list (listener, vip, status flag--enable)

At this moment, we just build the basic structure for testing, will


+ 12
- 10
octavia/amphorae/drivers/noop_driver/driver.py View File

@@ -57,16 +57,18 @@ class NoopManager(object):
loadbalancer.vip,
'active')

def start(self, loadbalancer, amphora=None):
LOG.debug("Amphora %s no-op, start listeners, lb %s, amp %s",
self.__class__.__name__, loadbalancer.id, amphora)
def start(self, loadbalancer, amphora=None, timeout_dict=None):
LOG.debug("Amphora %s no-op, start listeners, lb %s, amp %s"
"timeouts %s", self.__class__.__name__, loadbalancer.id,
amphora, timeout_dict)
self.amphoraconfig[
(loadbalancer.id, amphora.id)] = (loadbalancer, amphora,
'start')

def reload(self, loadbalancer, amphora=None):
LOG.debug("Amphora %s no-op, reload listeners, lb %s, amp %s",
self.__class__.__name__, loadbalancer.id, amphora)
def reload(self, loadbalancer, amphora=None, timeout_dict=None):
LOG.debug("Amphora %s no-op, reload listeners, lb %s, amp %s, "
"timeouts %s", self.__class__.__name__, loadbalancer.id,
amphora, timeout_dict)
self.amphoraconfig[
(loadbalancer.id, amphora.id)] = (loadbalancer, amphora,
'reload')
@@ -145,13 +147,13 @@ class NoopAmphoraLoadBalancerDriver(

self.driver.update(loadbalancer)

def start(self, loadbalancer, amphora=None):
def start(self, loadbalancer, amphora=None, timeout_dict=None):

self.driver.start(loadbalancer, amphora)
self.driver.start(loadbalancer, amphora, timeout_dict)

def reload(self, loadbalancer, amphora=None):
def reload(self, loadbalancer, amphora=None, timeout_dict=None):

self.driver.reload(loadbalancer, amphora)
self.driver.reload(loadbalancer, amphora, timeout_dict)

def delete(self, listener):



Loading…
Cancel
Save