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
changes/67/278867/2
Anant Patil 7 years ago committed by Anant Patil
parent 0e16abc96e
commit afd08e07b5
  1. 6
      heat/engine/worker.py
  2. 2
      heat/tests/engine/test_engine_worker.py

@ -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,

@ -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,

Loading…
Cancel
Save