Use stable Resource plugin interface in UpdateWaitConditionHandle

The update() function is internal and not guaranteed to be stable.
Resource plugins should override _needs_update() to control
update/replace behaviour.

Change-Id: I247b68669e692f6705e8adee60572c8e775ce0b8
Story: 2011068
Task: 49828
This commit is contained in:
Zane Bitter 2024-04-08 14:53:49 +12:00 committed by Takashi Kajinami
parent 80eea85194
commit 78119f60c6
2 changed files with 6 additions and 3 deletions

View File

@ -233,8 +233,8 @@ class UpdateWaitConditionHandle(aws_wch.WaitConditionHandle):
support_status = support.SupportStatus(version='2014.1')
def update(self, after, before=None, prev_resource=None,
new_template_id=None, new_requires=None):
def _needs_update(self, after, before, after_props, before_props,
prev_resource, check_init_complete=True):
raise resource.UpdateReplace(self.name)

View File

@ -25,6 +25,7 @@ from heat.engine.clients.os import swift as swift_plugin
from heat.engine import environment
from heat.engine import resource
from heat.engine.resources.openstack.heat import wait_condition_handle as h_wch
from heat.engine import scheduler
from heat.engine import stack as parser
from heat.engine import template as tmpl
from heat.objects import resource as resource_objects
@ -489,5 +490,7 @@ class HeatWaitConditionTest(common.HeatTestCase):
handle = self.stack['update_wait_handle']
self.assertEqual((handle.CREATE, handle.COMPLETE), handle.state)
self.assertRaises(
resource.UpdateReplace, handle.update, None, None)
resource.UpdateReplace,
scheduler.TaskRunner(handle.update, handle.t))