diff options
author | 2016-09-01 02:20:06 +0000 | |
---|---|---|
committer | 2016-09-01 02:20:06 +0000 | |
commit | 4dc69488bb019b83e5ccebf4c77f4d7f9fd8e7c1 (patch) | |
tree | 8d856e5bcc4d1cece71076767dc2039fcb839376 /tosca2heat/heat-translator/translator/hot/translate_node_templates.py | |
parent | 5298fb1f996ab547c518b085e8c39fc5e0665bd9 (diff) | |
parent | aef34ad9a966ca64aa365ee6aaada702b986f68b (diff) |
Merge "Fix BlockStorageAttachment bug when translate compute node"
Diffstat (limited to 'tosca2heat/heat-translator/translator/hot/translate_node_templates.py')
-rw-r--r-- | tosca2heat/heat-translator/translator/hot/translate_node_templates.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tosca2heat/heat-translator/translator/hot/translate_node_templates.py b/tosca2heat/heat-translator/translator/hot/translate_node_templates.py index f32d42b..4dd9556 100644 --- a/tosca2heat/heat-translator/translator/hot/translate_node_templates.py +++ b/tosca2heat/heat-translator/translator/hot/translate_node_templates.py @@ -533,14 +533,20 @@ class TranslateNodeTemplates(object): def _get_attachment_node(self, node, suffix, volume_name): attach = False ntpl = self.nodetemplates - for key, value in node.relationships.items(): - if key.is_derived_from('tosca.relationships.AttachesTo'): - if value.is_derived_from('tosca.nodes.BlockStorage'): + for key_r, value_n in node.relationships.items(): + if key_r.is_derived_from('tosca.relationships.AttachesTo'): + if value_n.is_derived_from('tosca.nodes.BlockStorage'): attach = True if attach: relationship_tpl = None for req in node.requirements: for key, val in req.items(): + if isinstance(val, dict): + if value_n.name != val.get('node'): + continue + else: + if value_n.name != val: + continue attach = val relship = val.get('relationship') for rkey, rval in val.items(): |