Add a way to get the resources depended on by an output
Change-Id: Ib17de40c4289df58002ca982bf4f2e319993948d
This commit is contained in:
parent
c40e1ce3fd
commit
6b6d3779cd
|
@ -14,6 +14,7 @@
|
|||
import copy
|
||||
import six
|
||||
|
||||
from heat.common import exception
|
||||
from heat.engine import function
|
||||
|
||||
|
||||
|
@ -25,11 +26,24 @@ class OutputDefinition(object):
|
|||
self._value = value
|
||||
self._resolved_value = None
|
||||
self._description = description
|
||||
self._deps = None
|
||||
|
||||
def validate(self, path=''):
|
||||
"""Validate the output value without resolving it."""
|
||||
function.validate(self._value, path)
|
||||
|
||||
def required_resource_names(self):
|
||||
if self._deps is None:
|
||||
try:
|
||||
required_resources = function.dependencies(self._value)
|
||||
self._deps = set(six.moves.map(lambda rp: rp.name,
|
||||
required_resources))
|
||||
except (exception.InvalidTemplateAttribute,
|
||||
exception.InvalidTemplateReference):
|
||||
# This output ain't gonna work anyway
|
||||
self._deps = set()
|
||||
return self._deps
|
||||
|
||||
def dep_attrs(self, resource_name):
|
||||
"""Iterate over attributes of a given resource that this references.
|
||||
|
||||
|
|
Loading…
Reference in New Issue