Skip to content

Commit

Permalink
(#CALM-39124) fix function signature for task tree decompile (#258)
Browse files Browse the repository at this point in the history
### Summary
fix function signature for rendering task tree template.

(cherry picked from commit d70114bae8d9e002fa58fb712ef9705174001293)
  • Loading branch information
Abhishekntnx authored and abhijeetkaurav1st committed Aug 11, 2023
1 parent 9b7a15e commit 0991708
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion calm/dsl/decompile/task_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ def render_task_tree_template(
CONFIG_SPEC_MAP,
decision_tasks=None,
while_tasks=None,
context="",
secrets_dict=[],
):
"""render task tree template"""

Expand All @@ -22,6 +24,8 @@ def render_task_tree_template(
entity_context,
RUNBOOK_ACTION_MAP,
CONFIG_SPEC_MAP,
context,
secrets_dict,
)
for tasks in ["success_tasks", "failure_tasks"]:
for task in decision_tasks[decision_task][tasks]:
Expand All @@ -30,6 +34,8 @@ def render_task_tree_template(
entity_context,
RUNBOOK_ACTION_MAP,
CONFIG_SPEC_MAP,
context,
secrets_dict,
)

while_loop_rendered_tasks = {}
Expand All @@ -40,10 +46,17 @@ def render_task_tree_template(
entity_context,
RUNBOOK_ACTION_MAP,
CONFIG_SPEC_MAP,
context,
secrets_dict,
)
for child_task in while_tasks[base_task]["child_tasks"]:
while_loop_rendered_tasks[child_task.name] = render_task_template(
child_task, entity_context, RUNBOOK_ACTION_MAP, CONFIG_SPEC_MAP
child_task,
entity_context,
RUNBOOK_ACTION_MAP,
CONFIG_SPEC_MAP,
context,
secrets_dict,
)
special_task_data = {"decision_tasks": decision_tasks, "while_tasks": while_tasks}
rendered_tasks = {}
Expand All @@ -69,6 +82,8 @@ def render_task_tree_template(
entity_context,
RUNBOOK_ACTION_MAP,
CONFIG_SPEC_MAP,
context,
secrets_dict,
)
task_indent_tree = []
visited = []
Expand Down

0 comments on commit 0991708

Please sign in to comment.