Don't treat ResourceDefinition as cfn template in resources
Remove the last few instances of treating a ResourceDefinition as a snippet of a CloudFormation template (rather than using the API) in various resources. Change-Id: I7266385121530b76d1955e466b3d51fae860a5ee
This commit is contained in:
parent
b3e59321a4
commit
f1751ae84c
contrib/rackspace/rackspace/resources
heat
engine/resources/openstack/heat
tests/openstack/heat
@ -749,7 +749,8 @@ class WebHook(resource.Resource):
|
||||
|
||||
def handle_update(self, json_snippet, tmpl_diff, prop_diff):
|
||||
asclient = self.auto_scale()
|
||||
args = self._get_args(json_snippet['Properties'])
|
||||
args = self._get_args(json_snippet.properties(self.properties_schema,
|
||||
self.context))
|
||||
args['webhook'] = self.resource_id
|
||||
asclient.replace_webhook(**args)
|
||||
|
||||
|
@ -276,8 +276,8 @@ class InstanceGroup(stack_resource.StackResource):
|
||||
def _update_timeout(self, batch_cnt, pause_sec):
|
||||
total_pause_time = pause_sec * max(batch_cnt - 1, 0)
|
||||
if total_pause_time >= self.stack.timeout_secs():
|
||||
msg = _('The current %s will result in stack update '
|
||||
'timeout.') % rsrc_defn.UPDATE_POLICY
|
||||
msg = _('The current update policy will result in stack update '
|
||||
'timeout.')
|
||||
raise ValueError(msg)
|
||||
return self.stack.timeout_secs() - total_pause_time
|
||||
|
||||
|
@ -227,11 +227,8 @@ class RemoteStack(resource.Resource):
|
||||
# Always issue an update to the remote stack and let the individual
|
||||
# resources in it decide if they need updating.
|
||||
if self.resource_id:
|
||||
snippet = json_snippet.get('Properties', {})
|
||||
self.properties = properties.Properties(self.properties_schema,
|
||||
snippet,
|
||||
function.resolve,
|
||||
self.name)
|
||||
self.properties = json_snippet.properties(self.properties_schema,
|
||||
self.context)
|
||||
|
||||
params = self.properties[self.PARAMETERS]
|
||||
env = environment.get_child_environment(self.stack.env, params)
|
||||
|
@ -27,7 +27,6 @@ from heat.engine import function
|
||||
from heat.engine.hot import template
|
||||
from heat.engine import properties
|
||||
from heat.engine.resources import stack_resource
|
||||
from heat.engine import rsrc_defn
|
||||
from heat.engine import scheduler
|
||||
from heat.engine import support
|
||||
from heat.scaling import rolling_update
|
||||
@ -560,8 +559,8 @@ class ResourceGroup(stack_resource.StackResource):
|
||||
def _update_timeout(self, batch_cnt, pause_sec):
|
||||
total_pause_time = pause_sec * max(batch_cnt - 1, 0)
|
||||
if total_pause_time >= self.stack.timeout_secs():
|
||||
msg = _('The current %s will result in stack update '
|
||||
'timeout.') % rsrc_defn.UPDATE_POLICY
|
||||
msg = _('The current update policy will result in stack update '
|
||||
'timeout.')
|
||||
raise ValueError(msg)
|
||||
return self.stack.timeout_secs() - total_pause_time
|
||||
|
||||
|
@ -1112,7 +1112,7 @@ class RollingUpdateTest(common.HeatTestCase):
|
||||
self.stack.timeout_secs = mock.Mock(return_value=200)
|
||||
err = self.assertRaises(ValueError, self.current_grp._update_timeout,
|
||||
3, 100)
|
||||
self.assertIn('The current UpdatePolicy will result in stack update '
|
||||
self.assertIn('The current update policy will result in stack update '
|
||||
'timeout.', six.text_type(err))
|
||||
|
||||
def test_update_time_sufficient(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user