Skip to content

Commit

Permalink
Bug/m escript3 task fixes (nutanix#292)
Browse files Browse the repository at this point in the history
DSL Fixes for :

- Tunnel support for escript(python3) tasks.
- depth variable fix for filename param for escript all task types

Bugs: https://jira.nutanix.com/browse/CALM-40389,
https://jira.nutanix.com/browse/CALM-40387
(cherry picked from commit 41c26c4b41441a61c84409047462f5e3a62e815e)
  • Loading branch information
anantsharma13352 authored and navtejpreetsingh committed Dec 15, 2023
1 parent 52bc710 commit 44ea3cc
Show file tree
Hide file tree
Showing 7 changed files with 457 additions and 11 deletions.
22 changes: 11 additions & 11 deletions calm/dsl/builtins/models/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ def _exec_create(
"Only one of script or filename should be given for exec task "
+ (name or "")
)
if script_type != "static" and tunnel is not None:
raise ValueError("Tunnel is supported only for Escript script type")
if script_type not in ["static", "static_py3"] and tunnel is not None:
raise ValueError("Tunnel is supported only for Escript script types")

if filename is not None:
file_path = os.path.join(
Expand Down Expand Up @@ -276,8 +276,8 @@ def _decision_create(
"One of script or filename is required for decision task " + (name or "")
)

if script_type != "static" and tunnel is not None:
raise ValueError("Tunnel is support only for Escript script type")
if script_type not in ["static", "static_py3"] and tunnel is not None:
raise ValueError("Tunnel is support only for Escript script types")

params = {
"name": name,
Expand Down Expand Up @@ -453,7 +453,7 @@ def exec_task_escript(
name=name,
target=target,
target_endpoint=None,
depth=depth + 1,
depth=depth,
tunnel=tunnel,
**kwargs,
)
Expand All @@ -475,7 +475,7 @@ def exec_task_escript_py3(
name=name,
target=target,
target_endpoint=None,
depth=depth + 1,
depth=depth,
tunnel=tunnel,
**kwargs,
)
Expand Down Expand Up @@ -644,7 +644,7 @@ def decision_task_escript(
filename=filename,
name=name,
target=target,
depth=depth + 1,
depth=depth,
tunnel=tunnel,
**kwargs,
)
Expand Down Expand Up @@ -678,7 +678,7 @@ def decision_task_escript_py3(
filename=filename,
name=name,
target=target,
depth=depth + 1,
depth=depth,
tunnel=tunnel,
**kwargs,
)
Expand Down Expand Up @@ -860,7 +860,7 @@ def __new__(
filename=filename,
name=name,
target=target,
depth=depth,
depth=depth + 1,
tunnel=tunnel,
**kwargs,
)
Expand All @@ -884,7 +884,7 @@ def __new__(
filename=filename,
name=name,
target=target,
depth=depth,
depth=depth + 1,
tunnel=tunnel,
**kwargs,
)
Expand All @@ -910,7 +910,7 @@ def __new__(
name=name,
target=target,
variables=variables,
depth=depth,
depth=depth + 1,
tunnel=tunnel,
**kwargs,
)
Expand Down
Loading

0 comments on commit 44ea3cc

Please sign in to comment.