NSX|V3+P: Prevent adding cookie session persistence to HTTPS listeners

HTTPS listeners are implemented on the NSX and L4 listeners,
and cannot support cookie session persistence profiles.

Change-Id: I8f776c33587e3f1d59a61e1571796fa84719baba
This commit is contained in:
Adit Sarfaty 2019-07-25 13:50:52 +03:00
parent 883816713d
commit 241c6f7368

View File

@ -29,7 +29,9 @@ def validate_session_persistence(pool, listener, completor):
# safety first! # safety first!
return return
# L4 listeners only allow source IP persistence # L4 listeners only allow source IP persistence
if (listener['protocol'] == lb_const.LB_PROTOCOL_TCP and # (HTTPS is also considers L4 listener)
if ((listener['protocol'] == lb_const.LB_PROTOCOL_TCP or
listener['protocol'] == lb_const.LB_PROTOCOL_HTTPS) and
sp['type'] != lb_const.LB_SESSION_PERSISTENCE_SOURCE_IP): sp['type'] != lb_const.LB_SESSION_PERSISTENCE_SOURCE_IP):
completor(success=False) completor(success=False)
msg = (_("Invalid session persistence type %(sp_type)s for " msg = (_("Invalid session persistence type %(sp_type)s for "