[Amphorav2] Fix noop driver case
Fix amphora creation with amphora_noop_driver and network_noop_driver. Change-Id: I5d3c4d5280916916e95120cfba6fc076a1650cf4 Story: 2005072
This commit is contained in:
parent
2c76209003
commit
6bca6bef1b
@ -130,7 +130,8 @@ class AmphoraLoadBalancerDriver(object):
|
|||||||
an offline pool after this call.
|
an offline pool after this call.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def post_vip_plug(self, amphora, load_balancer, amphorae_network_config):
|
def post_vip_plug(self, amphora, load_balancer, amphorae_network_config,
|
||||||
|
vrrp_port=None, vip_subnet=None):
|
||||||
"""Called after network driver has allocated and plugged the VIP
|
"""Called after network driver has allocated and plugged the VIP
|
||||||
|
|
||||||
:param amphora:
|
:param amphora:
|
||||||
@ -141,6 +142,12 @@ class AmphoraLoadBalancerDriver(object):
|
|||||||
:param amphorae_network_config: A data model containing information
|
:param amphorae_network_config: A data model containing information
|
||||||
about the subnets and ports that an
|
about the subnets and ports that an
|
||||||
amphorae owns.
|
amphorae owns.
|
||||||
|
:param vrrp_port: VRRP port associated with the load balancer
|
||||||
|
:type vrrp_port: octavia.network.data_models.Port
|
||||||
|
|
||||||
|
:param vip_subnet: VIP subnet associated with the load balancer
|
||||||
|
:type vip_subnet: octavia.network.data_models.Subnet
|
||||||
|
|
||||||
:type vip_network: octavia.network.data_models.AmphoraNetworkConfig
|
:type vip_network: octavia.network.data_models.AmphoraNetworkConfig
|
||||||
:returns: None
|
:returns: None
|
||||||
|
|
||||||
|
@ -94,7 +94,8 @@ class NoopManager(object):
|
|||||||
self.amphoraconfig[amphora.id, port.id] = (amphora.id, port.id,
|
self.amphoraconfig[amphora.id, port.id] = (amphora.id, port.id,
|
||||||
'post_network_plug')
|
'post_network_plug')
|
||||||
|
|
||||||
def post_vip_plug(self, amphora, load_balancer, amphorae_network_config):
|
def post_vip_plug(self, amphora, load_balancer, amphorae_network_config,
|
||||||
|
vrrp_port=None, vip_subnet=None):
|
||||||
LOG.debug("Amphora %s no-op, post vip plug load balancer %s",
|
LOG.debug("Amphora %s no-op, post vip plug load balancer %s",
|
||||||
self.__class__.__name__, load_balancer.id)
|
self.__class__.__name__, load_balancer.id)
|
||||||
self.amphoraconfig[(load_balancer.id, id(amphorae_network_config))] = (
|
self.amphoraconfig[(load_balancer.id, id(amphorae_network_config))] = (
|
||||||
@ -155,10 +156,12 @@ class NoopAmphoraLoadBalancerDriver(
|
|||||||
|
|
||||||
self.driver.post_network_plug(amphora, port)
|
self.driver.post_network_plug(amphora, port)
|
||||||
|
|
||||||
def post_vip_plug(self, amphora, load_balancer, amphorae_network_config):
|
def post_vip_plug(self, amphora, load_balancer, amphorae_network_config,
|
||||||
|
vrrp_port=None, vip_subnet=None):
|
||||||
|
|
||||||
self.driver.post_vip_plug(amphora,
|
self.driver.post_vip_plug(amphora,
|
||||||
load_balancer, amphorae_network_config)
|
load_balancer, amphorae_network_config,
|
||||||
|
vrrp_port=vrrp_port, vip_subnet=vip_subnet)
|
||||||
|
|
||||||
def upload_cert_amp(self, amphora, pem_file):
|
def upload_cert_amp(self, amphora, pem_file):
|
||||||
|
|
||||||
|
@ -275,9 +275,13 @@ class AmphoraPostVIPPlug(BaseAmphoraTask):
|
|||||||
vrrp_port = data_models.Port(
|
vrrp_port = data_models.Port(
|
||||||
**amphorae_network_config[
|
**amphorae_network_config[
|
||||||
amphora.get(constants.ID)][constants.VRRP_PORT])
|
amphora.get(constants.ID)][constants.VRRP_PORT])
|
||||||
vip_subnet = data_models.Subnet(
|
# Required for noop-case
|
||||||
**amphorae_network_config[
|
vip_arg = amphorae_network_config[amphora.get(
|
||||||
amphora.get(constants.ID)][constants.VIP_SUBNET])
|
constants.ID)][constants.VIP_SUBNET]
|
||||||
|
if vip_arg:
|
||||||
|
vip_subnet = data_models.Subnet(**vip_arg)
|
||||||
|
else:
|
||||||
|
vip_subnet = data_models.Subnet()
|
||||||
self.amphora_driver.post_vip_plug(
|
self.amphora_driver.post_vip_plug(
|
||||||
db_amp, db_lb, amphorae_network_config, vrrp_port=vrrp_port,
|
db_amp, db_lb, amphorae_network_config, vrrp_port=vrrp_port,
|
||||||
vip_subnet=vip_subnet)
|
vip_subnet=vip_subnet)
|
||||||
|
@ -151,7 +151,10 @@ class NoopManager(object):
|
|||||||
self.networkconfigconfig[network_id] = (network_id, 'get_network')
|
self.networkconfigconfig[network_id] = (network_id, 'get_network')
|
||||||
network = network_models.Network(id=uuidutils.generate_uuid())
|
network = network_models.Network(id=uuidutils.generate_uuid())
|
||||||
|
|
||||||
class ItIsInsideMe(object):
|
class ItIsInsideMe(network_models.Subnet):
|
||||||
|
def to_dict(self, **kwargs):
|
||||||
|
return [{}]
|
||||||
|
|
||||||
def __contains__(self, item):
|
def __contains__(self, item):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user