From c31eb4f5c708b7298edd020512d3be3038868625 Mon Sep 17 00:00:00 2001 From: Bui Doan Dang Date: Mon, 20 Feb 2023 15:06:41 +0700 Subject: [PATCH] fix heat update senlin cluster story: 2010578 task: 47331 Change-Id: I3706d662ec56e3548eb991556be7bd0f82f49e05 --- heat/engine/resources/openstack/senlin/cluster.py | 8 ++++---- heat/tests/openstack/senlin/test_cluster.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/heat/engine/resources/openstack/senlin/cluster.py b/heat/engine/resources/openstack/senlin/cluster.py index 02c59fa64f..6d68bb9197 100644 --- a/heat/engine/resources/openstack/senlin/cluster.py +++ b/heat/engine/resources/openstack/senlin/cluster.py @@ -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 diff --git a/heat/tests/openstack/senlin/test_cluster.py b/heat/tests/openstack/senlin/test_cluster.py index 32b39fb54c..5a451801c8 100644 --- a/heat/tests/openstack/senlin/test_cluster.py +++ b/heat/tests/openstack/senlin/test_cluster.py @@ -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)