From ba0b6676c07e944ba046b2b067832e0583163662 Mon Sep 17 00:00:00 2001 From: Jake Yip Date: Tue, 25 May 2021 23:44:43 +1000 Subject: [PATCH] Add availability_zone to OS::Octavia::LoadBalancer Change-Id: I63369b92b77b4f84bc2646ab35632006ee6b841b --- .../engine/resources/openstack/octavia/loadbalancer.py | 10 ++++++++-- heat/tests/openstack/octavia/inline_templates.py | 1 + heat/tests/openstack/octavia/test_loadbalancer.py | 1 + ...-availability-zone-to-octavia-193bcd2aee264fbd.yaml | 4 ++++ 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/add-availability-zone-to-octavia-193bcd2aee264fbd.yaml diff --git a/heat/engine/resources/openstack/octavia/loadbalancer.py b/heat/engine/resources/openstack/octavia/loadbalancer.py index fc639a81a8..0e866168f1 100644 --- a/heat/engine/resources/openstack/octavia/loadbalancer.py +++ b/heat/engine/resources/openstack/octavia/loadbalancer.py @@ -29,10 +29,10 @@ class LoadBalancer(octavia_base.OctaviaBase): PROPERTIES = ( DESCRIPTION, NAME, PROVIDER, VIP_ADDRESS, VIP_SUBNET, - ADMIN_STATE_UP, TENANT_ID, FLAVOR + ADMIN_STATE_UP, TENANT_ID, FLAVOR, AVAILABILITY_ZONE ) = ( 'description', 'name', 'provider', 'vip_address', 'vip_subnet', - 'admin_state_up', 'tenant_id', 'flavor' + 'admin_state_up', 'tenant_id', 'flavor', 'availability_zone' ) ATTRIBUTES = ( @@ -96,7 +96,13 @@ class LoadBalancer(octavia_base.OctaviaBase): constraints=[ constraints.CustomConstraint('octavia.flavor') ] + ), + AVAILABILITY_ZONE: properties.Schema( + properties.Schema.STRING, + _('The availability zone of the Load Balancer.'), + support_status=support.SupportStatus(version='17.0.0'), ) + } attributes_schema = { diff --git a/heat/tests/openstack/octavia/inline_templates.py b/heat/tests/openstack/octavia/inline_templates.py index c6453bd1d9..0b41946bf3 100644 --- a/heat/tests/openstack/octavia/inline_templates.py +++ b/heat/tests/openstack/octavia/inline_templates.py @@ -26,6 +26,7 @@ resources: tenant_id: 1234 admin_state_up: True flavor: f123 + availability_zone: nova ''' LISTENER_TEMPLATE = ''' diff --git a/heat/tests/openstack/octavia/test_loadbalancer.py b/heat/tests/openstack/octavia/test_loadbalancer.py index a93dda3f43..4badae5b34 100644 --- a/heat/tests/openstack/octavia/test_loadbalancer.py +++ b/heat/tests/openstack/octavia/test_loadbalancer.py @@ -62,6 +62,7 @@ class LoadBalancerTest(common.HeatTestCase): 'project_id': '1234', 'admin_state_up': True, 'flavor_id': 'f123', + 'availability_zone': 'nova', } } diff --git a/releasenotes/notes/add-availability-zone-to-octavia-193bcd2aee264fbd.yaml b/releasenotes/notes/add-availability-zone-to-octavia-193bcd2aee264fbd.yaml new file mode 100644 index 0000000000..2f133795b8 --- /dev/null +++ b/releasenotes/notes/add-availability-zone-to-octavia-193bcd2aee264fbd.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Add availabilty_zone parameter to OS::Octavia::LoadBalancer