Browse Source

NSX|V: Issue proper error on UDP listeners

Change-Id: I04b7345135c168840843eab633f4015f14d4f74f
changes/06/763906/1
asarfaty 2 months ago
committed by Adit Sarfaty
parent
commit
72b73a83b5
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      vmware_nsx/services/lbaas/nsx_v/implementation/listener_mgr.py

+ 10
- 0
vmware_nsx/services/lbaas/nsx_v/implementation/listener_mgr.py View File

@ -19,6 +19,8 @@ from oslo_log import helpers as log_helpers
from oslo_log import log as logging
from oslo_utils import excutils
from neutron_lib import exceptions as n_exc
from vmware_nsx._i18n import _
from vmware_nsx.common import exceptions as nsxv_exc
from vmware_nsx.common import locking
@ -159,6 +161,14 @@ class EdgeListenerManagerFromDict(base_mgr.EdgeLoadbalancerBaseManager):
context.session, lb_id)
edge_id = lb_binding['edge_id']
# Validate the listener protocol
if (listener.get('protocol') and
listener['protocol'] not in lb_const.PROTOCOL_MAP):
completor(success=False)
msg = (_("Listener protocol %s is not supported") %
listener['protocol'])
raise n_exc.BadRequest(resource='edge-lbaas', msg=msg)
if listener.get('default_pool') and listener['default_pool'].get('id'):
pool_binding = nsxv_db.get_nsxv_lbaas_pool_binding(
context.session, lb_id, listener['default_pool']['id'])


Loading…
Cancel
Save