Fixes few nits in the network features code
- add more detailed comment about the difference between depends_on and depends_on_nodes in translator/hot/syntax/hot_resource.py - fix few typos in translator/hot/translate_node_templates.py Change-Id: I4cf5d70b972213ba1baae64ef5ed2b8af49e1d17
This commit is contained in:
@@ -41,6 +41,17 @@ class HotResource(object):
|
||||
if type == 'OS::Heat::SoftwareConfig':
|
||||
self.properties['group'] = 'script'
|
||||
self.metadata = metadata
|
||||
|
||||
# The difference between depends_on and depends_on_nodes is
|
||||
# that depends_on defines dependency in the context of the
|
||||
# HOT template and it is used during the template output.
|
||||
# Depends_on_nodes defines the direct dependency between the
|
||||
# tosca nodes and is not used during the output of the
|
||||
# HOT template but for internal processing only. When a tosca
|
||||
# node depends on another node it will be always added to
|
||||
# depends_on_nodes but not always to depends_on. For example
|
||||
# if the source of dependency is a server, the dependency will
|
||||
# be added as properties.get_resource and not depends_on
|
||||
if depends_on:
|
||||
self.depends_on = depends_on
|
||||
self.depends_on_nodes = depends_on
|
||||
|
||||
@@ -81,7 +81,7 @@ class TranslateNodeTemplates():
|
||||
return self._translate_nodetemplates()
|
||||
|
||||
def _recursive_handle_properties(self, resource):
|
||||
'''Recursively handle the properties of the depens_on_nodes nodes.'''
|
||||
'''Recursively handle the properties of the depends_on_nodes nodes.'''
|
||||
# Use of hashtable (dict) here should be faster?
|
||||
if resource in self.processed_resources:
|
||||
return
|
||||
@@ -152,14 +152,14 @@ class TranslateNodeTemplates():
|
||||
|
||||
# handle built-in properties of HOT resources
|
||||
# if a resource depends on other resources,
|
||||
# their properties needs to be handled first.
|
||||
# their properties need to be handled first.
|
||||
# Use recursion to handle the properties of the
|
||||
# dependent nodes in correct order
|
||||
self.processed_resources = []
|
||||
for resource in self.hot_resources:
|
||||
self._recursive_handle_properties(resource)
|
||||
|
||||
# handle resources that need to expand to more then one HOT resource
|
||||
# handle resources that need to expand to more than one HOT resource
|
||||
expansion_resources = []
|
||||
for resource in self.hot_resources:
|
||||
expanded = resource.handle_expansion()
|
||||
|
||||
Reference in New Issue
Block a user