summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-12-02 06:10:47 +0000
committerGerrit Code Review <review@openstack.org>2018-12-02 06:10:47 +0000
commit0b83b051158f28160a8e3e73bc39c5304a60182f (patch)
tree8da7afb2f6e73c7c8ce086c661dd609ab2aad9b4
parentf4bf5aaa5038d37c66afdb4d60de9b5c134f13a4 (diff)
parent614ba0a98fdb2ed5404ea4a237154ad9870e8ae8 (diff)
downloadheat-0b83b051158f28160a8e3e73bc39c5304a60182f.tar.gz
Merge "Revert "Use OutputDefinition to generate attributes schema""
-rw-r--r--heat/engine/attributes.py8
-rw-r--r--heat/engine/resources/stack_resource.py4
-rw-r--r--heat/engine/resources/template_resource.py2
3 files changed, 8 insertions, 6 deletions
diff --git a/heat/engine/attributes.py b/heat/engine/attributes.py
index 407547c1f..47e50be56 100644
--- a/heat/engine/attributes.py
+++ b/heat/engine/attributes.py
@@ -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:
diff --git a/heat/engine/resources/stack_resource.py b/heat/engine/resources/stack_resource.py
index ec5bb7685..7def946c5 100644
--- a/heat/engine/resources/stack_resource.py
+++ b/heat/engine/resources/stack_resource.py
@@ -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))
diff --git a/heat/engine/resources/template_resource.py b/heat/engine/resources/template_resource.py
index 43fb81ec7..44959e966 100644
--- a/heat/engine/resources/template_resource.py
+++ b/heat/engine/resources/template_resource.py
@@ -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