Skip to content

Commit ac5a047

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Handle empty delay on update healthmonitor" into stable/2023.2
2 parents dfddb94 + b509b07 commit ac5a047

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

octavia/api/v2/controllers/health_monitor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ def _validate_healthmonitor_request_for_udp_sctp(self, request,
188188
request.type == consts.HEALTH_MONITOR_UDP_CONNECT)
189189
conf_min_delay = (
190190
CONF.api_settings.udp_connect_min_interval_health_monitor)
191-
if hm_is_type_udp and request.delay < conf_min_delay:
191+
if (hm_is_type_udp and
192+
not isinstance(request.delay, wtypes.UnsetType) and
193+
request.delay < conf_min_delay):
192194
raise exceptions.ValidationException(detail=_(
193195
"The request delay value %(delay)s should be larger than "
194196
"%(conf_min_delay)s for %(type)s health monitor type.") % {

octavia/tests/functional/api/v2/test_health_monitor.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1782,6 +1782,24 @@ def test_update_udp_case(self):
17821782
pool_prov_status=constants.PENDING_UPDATE,
17831783
hm_prov_status=constants.PENDING_UPDATE)
17841784

1785+
def test_update_udp_case_with_udp_hm(self):
1786+
api_hm = self.create_health_monitor(
1787+
self.udp_pool_with_listener_id,
1788+
constants.HEALTH_MONITOR_UDP_CONNECT, 3, 1, 1, 1).get(
1789+
self.root_tag)
1790+
self.set_lb_status(self.udp_lb_id)
1791+
new_hm = {'timeout': 2}
1792+
self.put(
1793+
self.HM_PATH.format(healthmonitor_id=api_hm.get('id')),
1794+
self._build_body(new_hm))
1795+
self.assert_correct_status(
1796+
lb_id=self.udp_lb_id, listener_id=self.udp_listener_id,
1797+
pool_id=self.udp_pool_with_listener_id, hm_id=api_hm.get('id'),
1798+
lb_prov_status=constants.PENDING_UPDATE,
1799+
listener_prov_status=constants.PENDING_UPDATE,
1800+
pool_prov_status=constants.PENDING_UPDATE,
1801+
hm_prov_status=constants.PENDING_UPDATE)
1802+
17851803
def test_negative_update_udp_case(self):
17861804
api_hm = self.create_health_monitor(
17871805
self.udp_pool_with_listener_id,
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
fixes:
3+
- |
4+
Fixed error on update UDP Health Monitor with empty "delay" parameter

0 commit comments

Comments
 (0)