Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new interface for Task inside variables #173

Open
abhijeetkaurav1st opened this issue May 5, 2021 · 0 comments
Open

Add new interface for Task inside variables #173

abhijeetkaurav1st opened this issue May 5, 2021 · 0 comments
Labels
P2 Minor

Comments

@abhijeetkaurav1st
Copy link
Collaborator

Right now, CalmTask is supported inside variables.
Even in Runbook, we need to import CalmTask for runbook dynanic variables.
Ex:

from calm.dsl.runbooks import runbook, runbook_json
from calm.dsl.runbooks import RunbookTask, RunbookVariable as Variable
from calm.dsl.builtins import CalmTask
@runbook
def DslCommunityRunbook():
    ntnx_calm_object = Variable.WithOptions.FromTask(
        CalmTask.HTTP.get(
            "https://api.github.com/repos/nutanixdev/calm-community/contents/",
            content_type="application/json",
            verify=True,
            status_mapping={200: True},
            response_paths={"ntnx_calm_object": "$[?(@.type == 'dir')].name"},
        ),
        is_mandatory=True,
    )
    RunbookTask.Exec.escript(script="print '0'")

Here both type of Task are used. It is creating confusion. Create a diff interface VariableTask that should be used for task inside variable always.

Also restrict the scope of VariableTask that contain tasks that can be used inside variable i.e. HTTP, escript

abhijeetkaurav1st added a commit that referenced this issue Mar 9, 2023
)

(cherry picked from commit c9380a3257a7624f0c3e7c358584086bc20de4be)
@abhijeetkaurav1st abhijeetkaurav1st added the P2 Minor label Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Minor
Projects
None yet
Development

No branches or pull requests

1 participant