Merge "Revert "Generate placeholders for resource proxies before validation""
This commit is contained in:
commit
2111551d50
@ -875,17 +875,10 @@ class Resource(status.ResourceStatus):
|
||||
def get_attrs(attrs):
|
||||
for attr in attrs:
|
||||
path = (attr,) if isinstance(attr, six.string_types) else attr
|
||||
if self.action == self.INIT:
|
||||
if (type(self).get_attribute != Resource.get_attribute or
|
||||
type(self).FnGetAtt != Resource.FnGetAtt or
|
||||
path[0] in self.attributes):
|
||||
# TODO(ricolin) make better placeholder values here
|
||||
yield path, None
|
||||
else:
|
||||
try:
|
||||
yield attr, self.get_attribute(*path)
|
||||
except exception.InvalidTemplateAttribute as ita:
|
||||
LOG.info('%s', ita)
|
||||
try:
|
||||
yield attr, self.get_attribute(*path)
|
||||
except exception.InvalidTemplateAttribute as ita:
|
||||
LOG.info('%s', ita)
|
||||
|
||||
dep_attrs = set(self.stack.get_dep_attrs(
|
||||
six.itervalues(self.stack.resources),
|
||||
|
@ -839,11 +839,10 @@ class Stack(collections.Mapping):
|
||||
raise exception.StackValidationFailed(
|
||||
message=_("Duplicate names %s") % dup_names)
|
||||
|
||||
iter_rsc = (self.dependencies if validate_by_deps
|
||||
else six.itervalues(resources))
|
||||
|
||||
for name, res in six.iteritems(resources):
|
||||
stk_defn.update_resource_data(self.defn, name, res.node_data())
|
||||
if validate_by_deps:
|
||||
iter_rsc = self.dependencies
|
||||
else:
|
||||
iter_rsc = six.itervalues(resources)
|
||||
|
||||
unique_defns = set(res.t for res in six.itervalues(resources))
|
||||
unique_defn_names = set(defn.name for defn in unique_defns)
|
||||
|
@ -604,7 +604,6 @@ class MiscMethodsTest(common.HeatTestCase):
|
||||
self.resource = self.stack['A']
|
||||
|
||||
def test_node_data_ok(self):
|
||||
self.resource.action = self.resource.CREATE
|
||||
expected_input_data = {'attrs': {(u'flat_dict', u'key2'): 'val2',
|
||||
(u'flat_dict', u'key3'): 'val3',
|
||||
(u'nested_dict', u'dict', u'a'): 1,
|
||||
@ -619,7 +618,6 @@ class MiscMethodsTest(common.HeatTestCase):
|
||||
self.assertEqual(expected_input_data, actual_input_data.as_dict())
|
||||
|
||||
def test_node_data_exception(self):
|
||||
self.resource.action = self.resource.CREATE
|
||||
expected_input_data = {'attrs': {},
|
||||
'id': mock.ANY,
|
||||
'reference_id': 'A',
|
||||
|
Loading…
Reference in New Issue
Block a user