Merge "fix heat update senlin cluster"

This commit is contained in:
Zuul 2023-03-06 08:03:28 +00:00 committed by Gerrit Code Review
commit ac53891e85
2 changed files with 6 additions and 6 deletions

View File

@ -322,11 +322,11 @@ class Cluster(res_base.BaseSenlinResource):
params['cluster'] = cluster_obj
if self.PROFILE in params:
params['profile_id'] = params.pop(self.PROFILE)
self.client().update_cluster(**params)
action = {
'func': 'update_cluster',
'params': params,
'action_id': None,
'done': False,
'cluster_id': self.resource_id,
'done': False
}
actions.append(action)
# Resize Cluster

View File

@ -196,7 +196,7 @@ class SenlinClusterTest(common.HeatTestCase):
rsrc_defns = template.Template(new_t).resource_definitions(self.stack)
new_cluster = rsrc_defns['senlin-cluster']
self.senlin_mock.update_cluster.return_value = mock.Mock(
location='/actions/fake-action')
cluster=new_cluster)
self.senlin_mock.get_action.return_value = mock.Mock(
status='SUCCEEDED')
scheduler.TaskRunner(cluster.update, new_cluster)()
@ -207,7 +207,7 @@ class SenlinClusterTest(common.HeatTestCase):
}
self.senlin_mock.update_cluster.assert_called_once_with(
cluster=self.fake_cl, **cluster_update_kwargs)
self.assertEqual(2, self.senlin_mock.get_action.call_count)
self.assertEqual(1, self.senlin_mock.get_action.call_count)
def test_cluster_update_desire_capacity(self):
cluster = self._create_cluster(self.t)