Github user mxmrlv commented on a diff in the pull request:
https://github.com/apache/incubator-ariatosca/pull/12#discussion_r85097190
--- Diff: aria/workflows/builtin/heal.py ---
@@ -34,28 +34,27 @@ def heal(context, graph, node_instance_id):
:param node_instance_id: the id of the node instance to heal
:return:
"""
- failing_node = context.storage.node_instance.get(node_instance_id)
- host_node = context.storage.node_instance.get(failing_node.host_id)
+ failing_node = context.model.node_instance.get(node_instance_id)
+ host_node = context.model.node_instance.get(failing_node.host_id)
failed_node_instance_subgraph = _get_contained_subgraph(context,
host_node)
failed_node_instance_ids = list(n.id for n in
failed_node_instance_subgraph)
- targeted_node_instances = [
- context.storage.node_instance.get(relationship_instance.target_id)
- for node_instance in failed_node_instance_subgraph
- for relationship_instance in node_instance.relationship_instances
- if relationship_instance.target_id not in failed_node_instance_ids
- ]
-
- graph.chain([
- heal_uninstall(
- context=context,
- failing_node_instances=failed_node_instance_subgraph,
- targeted_node_instances=targeted_node_instances),
- heal_install(
- context=context,
- failing_node_instances=failed_node_instance_subgraph,
- targeted_node_instances=targeted_node_instances)
- ])
+ targeted_node_instances = [node_instance for node_instance in
context.node_instances
+ if node_instance.id not in
failed_node_instance_ids]
+
+ uninstall_subgraph = heal_uninstall(
+ context=context,
+ failing_node_instances=failed_node_instance_subgraph,
+ targeted_node_instances=targeted_node_instances)
+
+ install_subgraph = heal_install(
+ context=context,
+ failing_node_instances=failed_node_instance_subgraph,
+ targeted_node_instances=targeted_node_instances)
+
+ graph.add_task(uninstall_subgraph)
--- End diff --
use sequence
---
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.
---