Github user ran-z commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/191#discussion_r136715926
  
    --- Diff: aria/modeling/service_instance.py ---
    @@ -228,6 +228,80 @@ def service_template_fk(cls):
         :type: :class:`~datetime.datetime`
         """)
     
    +    def get_node_by_type(self, type_name):
    +        """
    +        Finds the first node of a type (or descendent type).
    +        """
    +        service_template = self.service_template
    +
    +        if service_template is not None:
    +            node_types = service_template.node_types
    +            if node_types is not None:
    +                for node in self.nodes.itervalues():
    +                    if node_types.is_descendant(type_name, node.type.name):
    +                        return node
    +
    +        return None
    +
    +    def get_policy_by_type(self, type_name):
    +        """
    +        Finds the first policy of a type (or descendent type).
    +        """
    +        service_template = self.service_template
    +
    +        if service_template is not None:
    +            policy_types = service_template.policy_types
    +            if policy_types is not None:
    +                for policy in self.policies.itervalues():
    +                    if policy_types.is_descendant(type_name, 
policy.type.name):
    +                        return policy
    +
    +        return None
    +
    +    def satisfy_requirements(self):
    --- End diff --
    
    im not sure i understand this addition. who's calling this, and why is this 
a part of this PR?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to