Browse Source

Merge "Fix load balancer update with provider filtered params" into stable/stein

tags/4.1.2
Zuul 4 weeks ago
committed by Gerrit Code Review
parent
commit
5c9595f905
3 changed files with 22 additions and 1 deletions
  1. +1
    -1
      octavia/controller/worker/tasks/network_tasks.py
  2. +16
    -0
      octavia/tests/unit/controller/worker/tasks/test_network_tasks.py
  3. +5
    -0
      releasenotes/notes/fix-lb-update-with-no-data-abefe7860b8fb4c7.yaml

+ 1
- 1
octavia/controller/worker/tasks/network_tasks.py View File

@@ -595,7 +595,7 @@ class ApplyQos(BaseNetworkTask):
"""Apply qos policy on the vrrp ports which are related with vip."""
qos_policy_id = loadbalancer.vip.qos_policy_id
if not qos_policy_id and (
update_dict and (
not update_dict or (
'vip' not in update_dict or
'qos_policy_id' not in update_dict['vip'])):
return


+ 16
- 0
octavia/tests/unit/controller/worker/tasks/test_network_tasks.py View File

@@ -571,6 +571,22 @@ class TestNetworkTasks(base.TestCase):
t_constants.MOCK_QOS_POLICY_ID1, mock.ANY)
self.assertEqual(2, mock_driver.apply_qos_on_port.call_count)

mock_driver.reset_mock()
update_dict = {'description': 'fool',
'vip': {
'qos_policy_id': t_constants.MOCK_QOS_POLICY_ID1}}
tmp_lb.amphorae = AMPS_DATA
tmp_lb.topology = constants.TOPOLOGY_ACTIVE_STANDBY
net.execute(tmp_lb, update_dict=update_dict)
mock_driver.apply_qos_on_port.assert_called_with(
t_constants.MOCK_QOS_POLICY_ID1, mock.ANY)
self.assertEqual(2, mock_driver.apply_qos_on_port.call_count)

mock_driver.reset_mock()
update_dict = {}
net.execute(null_qos_lb, update_dict=update_dict)
self.assertEqual(0, mock_driver.apply_qos_on_port.call_count)

# revert
mock_driver.reset_mock()
tmp_lb.amphorae = [AMPS_DATA[0]]


+ 5
- 0
releasenotes/notes/fix-lb-update-with-no-data-abefe7860b8fb4c7.yaml View File

@@ -0,0 +1,5 @@
---
fixes:
- |
Fixed an issue where load balancers would go into ERROR when
setting data not visible to providers (e.g. tags).

Loading…
Cancel
Save