Browse Source

Fix updating a non-HTTP(S) Health Monitor

Prevent octavia-dashboard from sending parameters that trigger a
InvalidOption exception when updating a non-HTTP/non-HTTPS health
monitor.

Story 2008803
Task 42223

Change-Id: Ie669829b149001f77f7475216b86a33d96cb5ff5
changes/12/785112/1
Gregory Thiemonge 4 months ago
parent
commit
a8dc94fdbd
  1. 26
      octavia_dashboard/api/rest/lbaasv2.py
  2. 5
      releasenotes/notes/fix-updating-non-http-hm-114180139961e441.yaml

26
octavia_dashboard/api/rest/lbaasv2.py

@ -568,19 +568,27 @@ def update_monitor(request, **kwargs):
"""
data = request.DATA
monitor_id = data['monitor']['id']
hm_type = data['monitor']['type']
conn = _get_sdk_connection(request)
healthmonitor_kwargs = {
'delay': data['monitor'].get('delay'),
'timeout': data['monitor'].get('timeout'),
'max_retries': data['monitor'].get('max_retries'),
'max_retries_down': data['monitor'].get('max_retries_down'),
'admin_state_up': data['monitor'].get('admin_state_up'),
'name': data['monitor'].get('name')
}
if hm_type in ('HTTP', 'HTTPS'):
healthmonitor_kwargs.update({
'http_method': data['monitor'].get('http_method'),
'url_path': data['monitor'].get('url_path'),
'expected_codes': data['monitor'].get('expected_codes')
})
healthmonitor = conn.load_balancer.update_health_monitor(
monitor_id,
delay=data['monitor'].get('delay'),
timeout=data['monitor'].get('timeout'),
max_retries=data['monitor'].get('max_retries'),
max_retries_down=data['monitor'].get('max_retries_down'),
http_method=data['monitor'].get('http_method'),
url_path=data['monitor'].get('url_path'),
expected_codes=data['monitor'].get('expected_codes'),
admin_state_up=data['monitor'].get('admin_state_up'),
name=data['monitor'].get('name')
**healthmonitor_kwargs
)
return _get_sdk_object_dict(healthmonitor)

5
releasenotes/notes/fix-updating-non-http-hm-114180139961e441.yaml

@ -0,0 +1,5 @@
---
fixes:
- |
Fix a bug that prevented the update of non-HTTP and non-HTTPS health
monitors.
Loading…
Cancel
Save