Browse Source

Merge "Add availability_zone to the LoadBalancer model"

changes/47/699047/1 1.5.0
Zuul 2 years ago
committed by Gerrit Code Review
parent
commit
12d678a049
  1. 4
      octavia_lib/api/drivers/data_models.py
  2. 1
      octavia_lib/common/constants.py
  3. 13
      octavia_lib/tests/unit/api/drivers/test_data_models.py
  4. 4
      releasenotes/notes/add-az-to-loadbalancer-1e87b46ba29101d3.yaml
  5. 4
      zuul.d/projects.yaml

4
octavia_lib/api/drivers/data_models.py

@ -103,7 +103,8 @@ class LoadBalancer(BaseDataModel):
listeners=Unset, loadbalancer_id=Unset, name=Unset,
pools=Unset, project_id=Unset, vip_address=Unset,
vip_network_id=Unset, vip_port_id=Unset, vip_subnet_id=Unset,
vip_qos_policy_id=Unset, additional_vips=Unset):
vip_qos_policy_id=Unset, additional_vips=Unset,
availability_zone=Unset):
self.admin_state_up = admin_state_up
self.description = description
@ -119,6 +120,7 @@ class LoadBalancer(BaseDataModel):
self.vip_subnet_id = vip_subnet_id
self.vip_qos_policy_id = vip_qos_policy_id
self.additional_vips = additional_vips
self.availability_zone = availability_zone
class Listener(BaseDataModel):

1
octavia_lib/common/constants.py

@ -179,6 +179,7 @@ ADDITIONAL_VIPS = 'additional_vips'
ADDRESS = 'address'
ADMIN_STATE_UP = 'admin_state_up'
ALLOWED_CIDRS = 'allowed_cidrs'
AVAILABILITY_ZONE = 'availability_zone'
BACKUP = 'backup'
CA_TLS_CONTAINER_DATA = 'ca_tls_container_data'
CA_TLS_CONTAINER_REF = 'ca_tls_container_ref'

13
octavia_lib/tests/unit/api/drivers/test_data_models.py

@ -44,6 +44,7 @@ class TestProviderDataModels(base.TestCase):
self.healthmonitor_id = uuidutils.generate_uuid()
self.l7policy_id = uuidutils.generate_uuid()
self.l7rule_id = uuidutils.generate_uuid()
self.availability_zone = uuidutils.generate_uuid()
self.ref_l7rule = data_models.L7Rule(
admin_state_up=True,
@ -113,7 +114,8 @@ class TestProviderDataModels(base.TestCase):
vip_network_id=self.vip_network_id,
vip_port_id=self.vip_port_id,
vip_subnet_id=self.vip_subnet_id,
vip_qos_policy_id=self.vip_qos_policy_id)
vip_qos_policy_id=self.vip_qos_policy_id,
availability_zone=self.availability_zone)
self.ref_vip = data_models.VIP(
vip_address=self.vip_address,
@ -201,7 +203,8 @@ class TestProviderDataModels(base.TestCase):
'description': 'One great load balancer',
'vip_subnet_id': self.vip_subnet_id,
'name': 'favorite_lb',
'vip_qos_policy_id': self.vip_qos_policy_id}
'vip_qos_policy_id': self.vip_qos_policy_id,
'availability_zone': self.availability_zone}
self.ref_listener_dict = {
'admin_state_up': True,
@ -245,7 +248,8 @@ class TestProviderDataModels(base.TestCase):
'vip_network_id': self.vip_network_id,
'vip_port_id': self.vip_port_id,
'vip_subnet_id': self.vip_subnet_id,
'vip_qos_policy_id': self.vip_qos_policy_id}
'vip_qos_policy_id': self.vip_qos_policy_id,
'availability_zone': self.availability_zone}
self.ref_vip_dict = {
'vip_address': self.vip_address,
@ -419,7 +423,8 @@ class TestProviderDataModels(base.TestCase):
vip_network_id=self.vip_network_id,
vip_port_id=self.vip_port_id,
vip_subnet_id=self.vip_subnet_id,
vip_qos_policy_id=self.vip_qos_policy_id)
vip_qos_policy_id=self.vip_qos_policy_id,
availability_zone=self.availability_zone)
ref_lb_dict_with_listener = deepcopy(self.ref_lb_dict_with_listener)
ref_lb_dict_with_listener['pools'] = None

4
releasenotes/notes/add-az-to-loadbalancer-1e87b46ba29101d3.yaml

@ -0,0 +1,4 @@
---
other:
- |
Load balancer objects now have an ``availability_zone`` attribute. This can be None.

4
zuul.d/projects.yaml

@ -8,3 +8,7 @@
- publish-openstack-docs-pti
- release-notes-jobs-python3
- octavia-tox-tips
check:
jobs:
- octavia-tox-functional-py37-tips:
voting: false
Loading…
Cancel
Save