Fix parameters for update node when recovery with lb_policy
Change-Id: Ie7318baf698ee1bcf7f78c450e57cb31dbd1281a Closes-Bug: #1809652
This commit is contained in:
parent
5be096a324
commit
1e5e4dd8b4
@ -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
|
||||
|
@ -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': {}})
|
||||
|
Loading…
Reference in New Issue
Block a user