Merge "Only reset current resource's attrs in state_set"

This commit is contained in:
Jenkins 2017-02-22 22:39:46 +00:00 committed by Gerrit Code Review
commit 592346eacb
2 changed files with 1 additions and 10 deletions

View File

@ -1995,7 +1995,7 @@ class Resource(object):
if new_state != old_state:
self._add_event(action, status, reason)
self.stack.reset_resource_attributes()
self.attributes.reset_resolved_values()
@property
def state(self):

View File

@ -2006,15 +2006,6 @@ class Stack(collections.Mapping):
'tags': self.tags,
}
def reset_resource_attributes(self):
# nothing is cached if no resources exist
if not self._resources:
return
# a change in some resource may have side-effects in the attributes
# of other resources, so ensure that attributes are re-calculated
for res in six.itervalues(self.resources):
res.attributes.reset_resolved_values()
def has_cache_data(self, resource_name):
return (self.cache_data is not None and
self.cache_data.get(resource_name) is not None)