Fixed a DBerror on reducing node_count on bay
The method "create_k8s_api" expects a bay_uuid argument, but a bay was passed, which causes the error. Change-Id: I9cbf6c11bf62ea938624adf6f8c050097dab91ca Closes-Bug: #1539356
This commit is contained in:
parent
104d225466
commit
39270aefaf
|
@ -47,7 +47,7 @@ class ScaleManager(object):
|
|||
'stack_id': stack.id})
|
||||
|
||||
hosts_no_container = list(hosts)
|
||||
k8s_api = k8s.create_k8s_api(self.context, bay)
|
||||
k8s_api = k8s.create_k8s_api(self.context, bay.uuid)
|
||||
for pod in k8s_api.list_namespaced_pod(namespace='default').items:
|
||||
host = pod.spec.node_name
|
||||
if host in hosts_no_container:
|
||||
|
|
|
@ -59,6 +59,9 @@ class TestScaleManager(base.TestCase):
|
|||
else:
|
||||
removal_hosts = scale_mgr.get_removal_nodes(mock_heat_output)
|
||||
self.assertEqual(expected_removal_hosts, removal_hosts)
|
||||
if num_of_removal > 0:
|
||||
mock_create_k8s_api.assert_called_once_with(mock_context,
|
||||
mock_bay.uuid)
|
||||
|
||||
@mock.patch('magnum.objects.Bay.get_by_uuid')
|
||||
@mock.patch('magnum.conductor.scale_manager.ScaleManager._is_scale_down')
|
||||
|
|
Loading…
Reference in New Issue