From bbb0133a4729955917cff2b13ceb722d01d43857 Mon Sep 17 00:00:00 2001 From: Andrew Zong Date: Tue, 26 Jan 2021 08:44:17 +0800 Subject: [PATCH] Revert "change the algorithm from least-connection-node to least-connection-member for source_ip algorithm in neutorn" This reverts commit b8eff22e6da5cda08d0c523c01397eecaa825e6d. --- f5_openstack_agent/lbaasv2/drivers/bigip/service_adapter.py | 2 +- .../lbaasv2/drivers/bigip/test/test_service_adapter.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/f5_openstack_agent/lbaasv2/drivers/bigip/service_adapter.py b/f5_openstack_agent/lbaasv2/drivers/bigip/service_adapter.py index 0aa53e37e..58a4f2d31 100644 --- a/f5_openstack_agent/lbaasv2/drivers/bigip/service_adapter.py +++ b/f5_openstack_agent/lbaasv2/drivers/bigip/service_adapter.py @@ -422,7 +422,7 @@ def _get_lb_method(self, method): elif lb_method == 'RATIO_LEAST_CONNECTIONS': return 'ratio-least-connections-member' elif lb_method == 'SOURCE_IP': - return 'least-connections-member' + return 'least-connections-node' elif lb_method == 'OBSERVED_MEMBER': return 'observed-member' elif lb_method == 'PREDICTIVE_MEMBER': diff --git a/f5_openstack_agent/lbaasv2/drivers/bigip/test/test_service_adapter.py b/f5_openstack_agent/lbaasv2/drivers/bigip/test/test_service_adapter.py index cc644a31c..a8453a8cd 100644 --- a/f5_openstack_agent/lbaasv2/drivers/bigip/test/test_service_adapter.py +++ b/f5_openstack_agent/lbaasv2/drivers/bigip/test/test_service_adapter.py @@ -654,7 +654,7 @@ def test_pool_member_weight_source_ip(self, pool_member_service): srvc = copy.deepcopy(pool_member_service) srvc['pool']['lb_algorithm'] = 'SOURCE_IP' pool = adapter.get_pool(srvc) - assert pool['loadBalancingMode'] == 'least-connections-member' + assert pool['loadBalancingMode'] == 'least-connections-node' def test_pool_member_weight_bad_lb_method(self, pool_member_service): '''If lb method is bad and member has weight, lb is changed @@ -713,7 +713,7 @@ def test_pool_no_members_source_ip(self, pool_member_service): del srvc['members'] srvc['pool']['lb_algorithm'] = 'SOURCE_IP' pool = adapter.get_pool(srvc) - assert pool['loadBalancingMode'] == 'least-connections-member' + assert pool['loadBalancingMode'] == 'least-connections-node' def test_get_pool_monitor_no_monitor(self, basic_service): adapter = ServiceModelAdapter(mock.MagicMock())