Github user mxmrlv commented on a diff in the pull request:
https://github.com/apache/incubator-ariatosca/pull/72#discussion_r106804951
--- Diff: aria/orchestrator/workflows/builtin/utils.py ---
@@ -14,33 +14,38 @@
# limitations under the License.
from ..api.task import OperationTask
+from .. import exceptions
-def create_node_task(operation_name, node):
+def create_node_task(interface_name, operation_name, node):
"""
Returns a new operation task if the operation exists in the node,
otherwise returns None.
"""
- if _has_operation(node.interfaces, operation_name):
- return OperationTask.node(instance=node,
- name=operation_name)
- return None
+ try:
+ return OperationTask.for_node(node=node,
+ interface_name=interface_name,
+ operation_name=operation_name)
+ except exceptions.TaskException:
+ return None
-def create_relationship_tasks(operation_name, runs_on, node):
+def create_relationship_tasks(interface_name, operation_name, runs_on,
node):
"""
Returns a list of operation tasks for each outbound relationship of
the node if the operation
exists there.
"""
sequence = []
for relationship in node.outbound_relationships:
- if _has_operation(relationship.interfaces, operation_name):
+ try:
sequence.append(
- OperationTask.relationship(instance=relationship,
- name=operation_name,
- edge='source',
- runs_on=runs_on))
+ OperationTask.for_relationship(relationship=relationship,
+
interface_name=interface_name,
+
operation_name=operation_name,
+ runs_on=runs_on))
+ except exceptions.TaskException:
--- End diff --
ditto
---
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.
---