Github user ran-z commented on a diff in the pull request:
https://github.com/apache/incubator-ariatosca/pull/95#discussion_r111166567
--- Diff: aria/modeling/service_instance.py ---
@@ -529,6 +524,32 @@ def validate_capabilities(self):
satisfied = False
return satisfied
+ def find_host(self):
+ def _find_host(node):
+ if node.type.role == 'host':
+ return node
+ for the_relationship in node.outbound_relationships:
+ if (the_relationship.target_capability is not None) and \
+ the_relationship.target_capability.type.role == 'host':
+ host = _find_host(the_relationship.target_node)
+ if host is not None:
+ return host
+ for the_relationship in node.inbound_relationships:
+ if (the_relationship.target_capability is not None) and \
+ the_relationship.target_capability.type.role ==
'feature':
+ host = _find_host(the_relationship.source_node)
+ if host is not None:
+ return host
+ return None
+
+ self.host = _find_host(self)
--- End diff --
:+1:
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---