Convergence: Avoid cache when resolving input data

While constructing input-data for building the cache, the resource
attributes must resolve without hitting the cache again. It is
unnecessary to look into cache for resolving attributes of a freshly
baked resource.

Change-Id: I0893c17d87c687ca5cf370c4443f471160bd2f3c
This commit is contained in:
Anant Patil 2016-02-11 11:22:38 +05:30 committed by Anant Patil
parent 0e16abc96e
commit afd08e07b5
2 changed files with 4 additions and 4 deletions

View File

@ -334,15 +334,15 @@ def construct_input_data(rsrc, curr_stack):
for attr in attributes:
try:
if isinstance(attr, six.string_types):
resolved_attributes[attr] = rsrc.FnGetAtt(attr)
resolved_attributes[attr] = rsrc.get_attribute(attr)
else:
resolved_attributes[attr] = rsrc.FnGetAtt(*attr)
resolved_attributes[attr] = rsrc.get_attribute(*attr)
except exception.InvalidTemplateAttribute as ita:
LOG.info(six.text_type(ita))
input_data = {'id': rsrc.id,
'name': rsrc.name,
'reference_id': rsrc.FnGetRefId(),
'reference_id': rsrc.get_reference_id(),
'attrs': resolved_attributes,
'status': rsrc.status,
'action': rsrc.action,

View File

@ -621,7 +621,7 @@ class MiscMethodsTest(common.HeatTestCase):
'uuid': mock.ANY,
'action': mock.ANY,
'status': mock.ANY}
self.resource.FnGetAtt = mock.Mock(
self.resource.get_attribute = mock.Mock(
side_effect=exception.InvalidTemplateAttribute(resource='A',
key='value'))
actual_input_data = worker.construct_input_data(self.resource,