summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-06-18 13:12:58 +0000
committerGerrit Code Review <review@openstack.org>2017-06-18 13:12:58 +0000
commit467329c1e95facc0f50295b596f9083451b04f6b (patch)
treeb139a9695fbdd03ac4d4c9e65efaa917efa1eccd
parentb7a09fc0e825683e700bb8907347783d615181eb (diff)
parent35ae3206c5fc172e856ca1f86837bdef52769bb5 (diff)
Merge "NSX|V: Keep existing members when updating LBaaS pool"
-rw-r--r--vmware_nsx/services/lbaas/nsx_v/v2/pool_mgr.py4
-rw-r--r--vmware_nsx/tests/unit/nsx_v/test_edge_loadbalancer_driver_v2.py2
2 files changed, 6 insertions, 0 deletions
diff --git a/vmware_nsx/services/lbaas/nsx_v/v2/pool_mgr.py b/vmware_nsx/services/lbaas/nsx_v/v2/pool_mgr.py
index f766110..7632fba 100644
--- a/vmware_nsx/services/lbaas/nsx_v/v2/pool_mgr.py
+++ b/vmware_nsx/services/lbaas/nsx_v/v2/pool_mgr.py
@@ -122,6 +122,10 @@ class EdgePoolManager(base_mgr.EdgeLoadbalancerBaseManager):
122 if monitor_id: 122 if monitor_id:
123 edge_pool['monitorId'] = monitor_id 123 edge_pool['monitorId'] = monitor_id
124 124
125 # Keep the current members
126 if org_edge_pool.get('member'):
127 edge_pool['member'] = org_edge_pool['member']
128
125 self.vcns.update_pool(edge_id, edge_pool_id, edge_pool) 129 self.vcns.update_pool(edge_id, edge_pool_id, edge_pool)
126 130
127 self.lbv2_driver.pool.successful_completion(context, new_pool) 131 self.lbv2_driver.pool.successful_completion(context, new_pool)
diff --git a/vmware_nsx/tests/unit/nsx_v/test_edge_loadbalancer_driver_v2.py b/vmware_nsx/tests/unit/nsx_v/test_edge_loadbalancer_driver_v2.py
index f46694d..39f59d5 100644
--- a/vmware_nsx/tests/unit/nsx_v/test_edge_loadbalancer_driver_v2.py
+++ b/vmware_nsx/tests/unit/nsx_v/test_edge_loadbalancer_driver_v2.py
@@ -430,12 +430,14 @@ class TestEdgeLbaasV2Pool(BaseTestEdgeLbaasV2):
430 mock_get_pool_binding.return_value = POOL_BINDING 430 mock_get_pool_binding.return_value = POOL_BINDING
431 fake_edge = EDGE_POOL_DEF.copy() 431 fake_edge = EDGE_POOL_DEF.copy()
432 fake_edge['monitorId'] = 'monitor-7' 432 fake_edge['monitorId'] = 'monitor-7'
433 fake_edge['member'] = ['member1', 'member2']
433 mock_get_pool.return_value = (None, fake_edge) 434 mock_get_pool.return_value = (None, fake_edge)
434 self.edge_driver.pool.update(self.context, self.pool, new_pool) 435 self.edge_driver.pool.update(self.context, self.pool, new_pool)
435 436
436 edge_pool_def = EDGE_POOL_DEF.copy() 437 edge_pool_def = EDGE_POOL_DEF.copy()
437 edge_pool_def['algorithm'] = 'leastconn' 438 edge_pool_def['algorithm'] = 'leastconn'
438 edge_pool_def['monitorId'] = 'monitor-7' 439 edge_pool_def['monitorId'] = 'monitor-7'
440 edge_pool_def['member'] = ['member1', 'member2']
439 mock_upd_pool.assert_called_with( 441 mock_upd_pool.assert_called_with(
440 LB_EDGE_ID, EDGE_POOL_ID, edge_pool_def) 442 LB_EDGE_ID, EDGE_POOL_ID, edge_pool_def)
441 mock_upd_app_prof.assert_called_with(LB_EDGE_ID, 443 mock_upd_app_prof.assert_called_with(LB_EDGE_ID,