Merge "Prohibit use of UDP-CONNECT healthmonitor" into stable/ussuri

This commit is contained in:
Zuul 2021-04-28 09:14:21 +00:00 committed by Gerrit Code Review
commit 434d6af1a7
2 changed files with 6 additions and 1 deletions

View File

@ -38,6 +38,7 @@ LB_HEALTH_MONITOR_PING = 'PING'
LB_HEALTH_MONITOR_TCP = 'TCP' LB_HEALTH_MONITOR_TCP = 'TCP'
LB_HEALTH_MONITOR_HTTP = 'HTTP' LB_HEALTH_MONITOR_HTTP = 'HTTP'
LB_HEALTH_MONITOR_HTTPS = 'HTTPS' LB_HEALTH_MONITOR_HTTPS = 'HTTPS'
LB_HEALTH_MONITOR_UDP_CONNECT = 'UDP-CONNECT'
HEALTH_MONITOR_MAP = { HEALTH_MONITOR_MAP = {
LB_HEALTH_MONITOR_PING: 'icmp', LB_HEALTH_MONITOR_PING: 'icmp',

View File

@ -33,9 +33,9 @@ from octavia_lib.api.drivers import exceptions
from octavia_lib.api.drivers import provider_base as driver_base from octavia_lib.api.drivers import provider_base as driver_base
from vmware_nsx.services.lbaas import lb_const
from vmware_nsx.services.lbaas.octavia import constants as d_const from vmware_nsx.services.lbaas.octavia import constants as d_const
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
cfg.CONF.import_group('oslo_messaging', 'octavia.common.config') cfg.CONF.import_group('oslo_messaging', 'octavia.common.config')
@ -508,6 +508,10 @@ class NSXOctaviaDriver(driver_base.ProviderDriver):
# Health Monitor # Health Monitor
@log_helpers.log_method_call @log_helpers.log_method_call
def health_monitor_create(self, healthmonitor): def health_monitor_create(self, healthmonitor):
if healthmonitor.type == lb_const.LB_HEALTH_MONITOR_UDP_CONNECT:
raise exceptions.UnsupportedOptionError(
user_fault_string="UDP-CONNECT monitor is not supported")
kw = {'healthmonitor': self.obj_to_dict(healthmonitor)} kw = {'healthmonitor': self.obj_to_dict(healthmonitor)}
self.client.cast({}, 'healthmonitor_create', **kw) self.client.cast({}, 'healthmonitor_create', **kw)