diff options
Diffstat (limited to 'tosca2heat/heat-translator/translator/hot')
3 files changed, 12 insertions, 6 deletions
diff --git a/tosca2heat/heat-translator/translator/hot/tests/test_translate_outputs.py b/tosca2heat/heat-translator/translator/hot/tests/test_translate_outputs.py index 955150e..c02a547 100644 --- a/tosca2heat/heat-translator/translator/hot/tests/test_translate_outputs.py +++ b/tosca2heat/heat-translator/translator/hot/tests/test_translate_outputs.py @@ -33,12 +33,12 @@ class ToscaTemplateOutputTest(TestCase): 'server, http://<IP>:3000', 'value': {'get_attr': - ['app_server', 'networks', 'private', 0]}}, + ['app_server', 'networks']}}, 'mongodb_url': {'description': 'URL for the mongodb server.', 'value': {'get_attr': - ['mongo_server', 'networks', 'private', 0]}}} + ['mongo_server', 'networks']}}} hot_translation_dict = \ toscaparser.utils.yamlparser.simple_parse(hot_translation) diff --git a/tosca2heat/heat-translator/translator/hot/tosca/tosca_compute.py b/tosca2heat/heat-translator/translator/hot/tosca/tosca_compute.py index 45637ec..9ceb049 100644 --- a/tosca2heat/heat-translator/translator/hot/tosca/tosca_compute.py +++ b/tosca2heat/heat-translator/translator/hot/tosca/tosca_compute.py @@ -332,7 +332,7 @@ class ToscaCompute(HotResource): attriute.')) if attribute == 'private_address' or \ attribute == 'public_address': - attr['get_attr'] = [self.name, 'networks', 'private', 0] + attr['get_attr'] = [self.name, 'networks'] return attr 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(): |