Merge "Don't load non-referenced resources from DB" into stable/newton

This commit is contained in:
Jenkins 2017-06-16 05:19:02 +00:00 committed by Gerrit Code Review
commit d6499b65ad
2 changed files with 3 additions and 2 deletions

View File

@ -259,11 +259,11 @@ class Resource(object):
self.current_template_id = None
self.root_stack_id = None
if not stack.has_cache_data(name):
if stack.cache_data is None:
resource = stack.db_resource_get(name)
if resource:
self._load_data(resource)
else:
elif stack.has_cache_data(name):
self.action = stack.cache_data[name]['action']
self.status = stack.cache_data[name]['status']
self.id = stack.cache_data[name]['id']

View File

@ -1194,6 +1194,7 @@ class Stack(collections.Mapping):
self.t = template
self.reset_dependencies()
self._resources = None
self.cache_data = None
if action is not self.CREATE:
self.updated_time = oslo_timeutils.utcnow()