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):
|
def get_attrs(attrs):
|
||||||
for attr in attrs:
|
for attr in attrs:
|
||||||
path = (attr,) if isinstance(attr, six.string_types) else attr
|
path = (attr,) if isinstance(attr, six.string_types) else attr
|
||||||
if self.action == self.INIT:
|
try:
|
||||||
if (type(self).get_attribute != Resource.get_attribute or
|
yield attr, self.get_attribute(*path)
|
||||||
type(self).FnGetAtt != Resource.FnGetAtt or
|
except exception.InvalidTemplateAttribute as ita:
|
||||||
path[0] in self.attributes):
|
LOG.info('%s', ita)
|
||||||
# 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)
|
|
||||||
|
|
||||||
dep_attrs = set(self.stack.get_dep_attrs(
|
dep_attrs = set(self.stack.get_dep_attrs(
|
||||||
six.itervalues(self.stack.resources),
|
six.itervalues(self.stack.resources),
|
||||||
|
@ -839,11 +839,10 @@ class Stack(collections.Mapping):
|
|||||||
raise exception.StackValidationFailed(
|
raise exception.StackValidationFailed(
|
||||||
message=_("Duplicate names %s") % dup_names)
|
message=_("Duplicate names %s") % dup_names)
|
||||||
|
|
||||||
iter_rsc = (self.dependencies if validate_by_deps
|
if validate_by_deps:
|
||||||
else six.itervalues(resources))
|
iter_rsc = self.dependencies
|
||||||
|
else:
|
||||||
for name, res in six.iteritems(resources):
|
iter_rsc = six.itervalues(resources)
|
||||||
stk_defn.update_resource_data(self.defn, name, res.node_data())
|
|
||||||
|
|
||||||
unique_defns = set(res.t for res in 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)
|
unique_defn_names = set(defn.name for defn in unique_defns)
|
||||||
|
@ -604,7 +604,6 @@ class MiscMethodsTest(common.HeatTestCase):
|
|||||||
self.resource = self.stack['A']
|
self.resource = self.stack['A']
|
||||||
|
|
||||||
def test_node_data_ok(self):
|
def test_node_data_ok(self):
|
||||||
self.resource.action = self.resource.CREATE
|
|
||||||
expected_input_data = {'attrs': {(u'flat_dict', u'key2'): 'val2',
|
expected_input_data = {'attrs': {(u'flat_dict', u'key2'): 'val2',
|
||||||
(u'flat_dict', u'key3'): 'val3',
|
(u'flat_dict', u'key3'): 'val3',
|
||||||
(u'nested_dict', u'dict', u'a'): 1,
|
(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())
|
self.assertEqual(expected_input_data, actual_input_data.as_dict())
|
||||||
|
|
||||||
def test_node_data_exception(self):
|
def test_node_data_exception(self):
|
||||||
self.resource.action = self.resource.CREATE
|
|
||||||
expected_input_data = {'attrs': {},
|
expected_input_data = {'attrs': {},
|
||||||
'id': mock.ANY,
|
'id': mock.ANY,
|
||||||
'reference_id': 'A',
|
'reference_id': 'A',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user