Browse Source

Merge "Fix the check for allowed_cidrs in listeners"

changes/29/754429/1
Zuul 10 months ago
committed by Gerrit Code Review
parent
commit
a6775f9859
  1. 25
      ovn_octavia_provider/driver.py

25
ovn_octavia_provider/driver.py

@ -58,6 +58,16 @@ class OvnProviderDriver(driver_base.ProviderDriver):
user_fault_string=msg,
operator_fault_string=msg)
def _check_for_allowed_cidrs(self, allowed_cidrs):
# TODO(haleyb): add support for this
if isinstance(allowed_cidrs, o_datamodels.UnsetType):
allowed_cidrs = []
if allowed_cidrs:
msg = _('OVN provider does not support allowed_cidrs option')
raise driver_exceptions.UnsupportedOptionError(
user_fault_string=msg,
operator_fault_string=msg)
def loadbalancer_create(self, loadbalancer):
admin_state_up = loadbalancer.admin_state_up
if isinstance(admin_state_up, o_datamodels.UnsetType):
@ -138,12 +148,8 @@ class OvnProviderDriver(driver_base.ProviderDriver):
def listener_create(self, listener):
self._check_for_supported_protocols(listener.protocol)
# TODO(haleyb): add support for this
if not isinstance(listener.allowed_cidrs, o_datamodels.UnsetType):
msg = _('OVN provider does not support allowed_cidrs option')
raise driver_exceptions.UnsupportedOptionError(
user_fault_string=msg,
operator_fault_string=msg)
self._check_for_allowed_cidrs(listener.allowed_cidrs)
admin_state_up = listener.admin_state_up
if isinstance(admin_state_up, o_datamodels.UnsetType):
admin_state_up = True
@ -167,12 +173,7 @@ class OvnProviderDriver(driver_base.ProviderDriver):
self._ovn_helper.add_request(request)
def listener_update(self, old_listener, new_listener):
# TODO(haleyb): add support for this
if not isinstance(new_listener.allowed_cidrs, o_datamodels.UnsetType):
msg = _('OVN provider does not support allowed_cidrs option')
raise driver_exceptions.UnsupportedOptionError(
user_fault_string=msg,
operator_fault_string=msg)
self._check_for_allowed_cidrs(new_listener.allowed_cidrs)
request_info = {'id': new_listener.listener_id,
'loadbalancer_id': old_listener.loadbalancer_id,

Loading…
Cancel
Save