_get_explicit_relationship() only looks at the first relationship
- Fixed a bug in _get_explicit_relationship() that was causing only
the first relationship to be returned, or none at all. The break
statement needed to be inside the if condition so that it would
loop through all of the available relationships to find the one
it is looking for.
Change-Id: I74e4a9945c25f87a0d6d5fdf4f302d762655e48b
This commit is contained in:
@@ -104,7 +104,7 @@ class NodeTemplate(EntityTemplate):
|
||||
if key in req_dict.keys():
|
||||
relationship = (req_dict.get(key).
|
||||
get('relationship'))
|
||||
break
|
||||
break
|
||||
if relationship:
|
||||
found_relationship_tpl = False
|
||||
# apply available relationship templates if found
|
||||
|
||||
@@ -218,6 +218,8 @@ class ToscaTemplateTest(TestCase):
|
||||
interface.name)
|
||||
self.assertEqual(artifact,
|
||||
interface.implementation)
|
||||
if node_tpl.name == 'paypal_pizzastore':
|
||||
self.assertEqual(len(node_tpl.relationships), 2)
|
||||
|
||||
def test_template_macro(self):
|
||||
template = ToscaTemplate(self.tosca_elk_tpl)
|
||||
|
||||
Reference in New Issue
Block a user