ariatosca-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mxmrlv <...@git.apache.org>
Subject [GitHub] incubator-ariatosca pull request #156: ARIA-278 remove core tasks
Date Tue, 20 Jun 2017 12:10:27 GMT
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/156#discussion_r122947448
  
    --- Diff: aria/modeling/orchestration.py ---
    @@ -392,8 +397,66 @@ def abort(message=None):
         def retry(message=None, retry_interval=None):
             raise TaskRetryException(message, retry_interval=retry_interval)
     
    +    @declared_attr
    +    def dependency_fk(self):
    +        return relationship.foreign_key('task', nullable=True)
    +
    +    @declared_attr
    +    def dependencies(cls):
    +        # symmetric relationship causes funky graphs
    +        return relationship.one_to_many_self(cls, 'dependency_fk')
    +
    +    def has_ended(self):
    +        return self.status in (self.SUCCESS, self.FAILED)
    +
    +    def is_waiting(self):
    +        if self.stub_type:
    +            return not self.has_ended()
    +        else:
    +            return self.status in (self.PENDING, self.RETRYING)
    +
    +    @classmethod
    +    def from_api_task(cls, api_task, executor, **kwargs):
    +        from aria.orchestrator import context
    +        instantiation_kwargs = {}
    +
    +        if hasattr(api_task.actor, 'outbound_relationships'):
    --- End diff --
    
    maybe api_task has `node` attribute


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

Mime
View raw message