Add Output definitions to StackDefinition

Change-Id: I8356980d8687b2f1ffb4abe198adec8e70f00f69
Partially-Implements: blueprint stack-definition
This commit is contained in:
Zane Bitter 2017-07-19 17:35:39 -04:00
parent 6c87950521
commit 82721f8865
1 changed files with 16 additions and 0 deletions

View File

@ -42,6 +42,7 @@ class StackDefinition(object):
template.env.param_defaults)
self._resource_defns = None
self._resources = {}
self._output_defns = None
def clone_with_new_template(self, new_template, stack_identifier,
clear_resource_data=False):
@ -75,6 +76,21 @@ class StackDefinition(object):
self._load_rsrc_defns()
return set(self._resource_defns)
def _load_output_defns(self):
self._output_defns = self._template.outputs(self)
def output_definition(self, output_name):
"""Return the definition of the given output."""
if self._output_defns is None:
self._load_output_defns()
return self._output_defns[output_name]
def enabled_output_names(self):
"""Return the set of names of all enabled outputs in the template."""
if self._output_defns is None:
self._load_output_defns()
return set(self._output_defns)
def all_rsrc_names(self):
"""Return the set of names of all resources in the template.