Fix parameters for update node when recovery with lb_policy

Change-Id: Ie7318baf698ee1bcf7f78c450e57cb31dbd1281a
Closes-Bug: #1809652
This commit is contained in:
sapd 2018-12-24 18:54:35 +07:00 committed by sapd
parent 5be096a324
commit 1e5e4dd8b4
2 changed files with 4 additions and 4 deletions

View File

@ -571,7 +571,7 @@ class LoadBalancingPolicy(base.Policy):
# lb_member is None, need to add to lb pool
if not lb_member:
values['data'] = data
no.Node.update(action.context, values)
no.Node.update(action.context, node.id, values)
return candidates
# was a member of lb pool, check whether has been recreated
@ -580,7 +580,7 @@ class LoadBalancingPolicy(base.Policy):
handle_err=False)
data.pop('lb_member', None)
values['data'] = data
no.Node.update(action.context, values)
no.Node.update(action.context, node.id, values)
return candidates
return None

View File

@ -1133,7 +1133,7 @@ class TestLoadBalancingPolicyOperations(base.SenlinTestCase):
res = policy._process_recovery(['NODE'], cp, self.lb_driver, action)
self.assertEqual(['NODE'], res)
m_update.assert_called_once_with(action.context, {'data': {}})
m_update.assert_called_once_with(action.context, 'NODE', {'data': {}})
@mock.patch.object(no.Node, 'update')
@mock.patch.object(lb_policy.LoadBalancingPolicy, '_remove_member')
@ -1172,4 +1172,4 @@ class TestLoadBalancingPolicyOperations(base.SenlinTestCase):
self.assertEqual(['NODE'], res)
m_remove.assert_called_once_with(action.context, ['NODE'], cp,
self.lb_driver, handle_err=False)
m_update.assert_called_once_with(action.context, {'data': {}})
m_update.assert_called_once_with(action.context, 'NODE', {'data': {}})