Merge "Revert "Use OutputDefinition to generate attributes schema""
This commit is contained in:
commit
0b83b05115
@ -200,9 +200,11 @@ class Attributes(collections.Mapping):
|
||||
return outp
|
||||
|
||||
@staticmethod
|
||||
def schema_from_outputs(outputs):
|
||||
return dict((o.name, Schema(o.description()))
|
||||
for o in outputs.values())
|
||||
def schema_from_outputs(json_snippet):
|
||||
if json_snippet:
|
||||
return dict((k, Schema(v.get("Description")))
|
||||
for k, v in json_snippet.items())
|
||||
return {}
|
||||
|
||||
def _validate_type(self, attrib, value):
|
||||
if attrib.schema.type == attrib.schema.STRING:
|
||||
|
@ -92,8 +92,8 @@ class StackResource(resource.Resource):
|
||||
|
||||
return "nested_stack"
|
||||
|
||||
def _outputs_to_attribs(self, parsed_template):
|
||||
outputs = parsed_template.outputs(None)
|
||||
def _outputs_to_attribs(self, json_snippet):
|
||||
outputs = json_snippet.get('Outputs')
|
||||
if not self.attributes and outputs:
|
||||
self.attributes_schema = (
|
||||
attributes.Attributes.schema_from_outputs(outputs))
|
||||
|
@ -108,7 +108,7 @@ class TemplateResource(stack_resource.StackResource):
|
||||
return ((properties.Properties.schema_from_params(
|
||||
tmpl.param_schemata(param_defaults))),
|
||||
(attributes.Attributes.schema_from_outputs(
|
||||
tmpl.outputs(None))))
|
||||
tmpl[tmpl.OUTPUTS])))
|
||||
|
||||
def _generate_schema(self):
|
||||
self._parsed_nested = None
|
||||
|
Loading…
Reference in New Issue
Block a user