[Bug] Single VM BP does not keep dependencies in task sequence | calm create bp | calm decompile bp
glover-chris opened this issue · comments
glover-chris commented
Describe the bug
When creating a single VM bp, if you have parallel tasks that then call different sub tasks within each parallel step, all sub tasks are run from each parallel task.
Branch/Container
master
To Reproduce
Steps to reproduce the behavior:
-
DSL decompile of that bp action looks like this .
@action
def __uninstall__():
with parallel():
CalmTask.Exec.powershell(
name="domain_unjoin",
filename=os.path.join(
"scripts",
"Package_Package1_Action___uninstall___Task_domain_unjoin.ps1",
),
cred=ref(BP_CRED_cred_ad),
target=ref(Service1),
)
CalmTask.SetVariable.powershell(
name="citrix_token",
filename=os.path.join(
"scripts",
"Package_Package1_Action___uninstall___Task_citrix_token.ps1",
),
cred=ref(BP_CRED_cred_citrix),
target=ref(Service1),
variables=["token"],
)
with parallel():
CalmTask.Exec.powershell(
name="remove_ad_object",
filename=os.path.join(
"scripts",
"Package_Package1_Action___uninstall___Task_remove_ad_object.ps1",
),
cred=ref(BP_CRED_cred_ad),
target=ref(Service1),
)
CalmTask.Exec.powershell(
name="citrix_cleanup",
filename=os.path.join(
"scripts",
"Package_Package1_Action___uninstall___Task_citrix_cleanup.ps1",
),
cred=ref(BP_CRED_cred_citrix),
target=ref(Service1),
)
- creating the bp with DSL, the tasks looks like this in the GUI. You can see the first parallel tasks run but then also call each sub task when they should only call one sub task under the parent.
with this code in the bp.
@action
def __uninstall__():
with parallel():
CalmTask.Exec.powershell(
name="domain_unjoin",
filename=common_task_library + "windows/uninstall/domain_unjoin.ps1",
cred=ref(BP_CRED_cred_ad),
target=ref(Service1),
)
CalmTask.SetVariable.powershell(
name="citrix_token",
filename=common_task_library + "shared/precreate/citrix_token.ps1",
cred=ref(BP_CRED_cred_citrix),
target=ref(Service1),
variables=["token"],
target_endpoint=Endpoint.use_existing(poshendpoint),
)
with parallel():
CalmTask.Exec.powershell(
name="remove_ad_object",
filename=common_task_library + "windows/uninstall/remove_ad_object.ps1",
cred=ref(BP_CRED_cred_ad),
target=ref(Service1),
target_endpoint=Endpoint.use_existing(poshendpoint),
)
CalmTask.Exec.powershell(
name="citrix_cleanup",
filename=common_task_library + "windows/uninstall/citrix_cleanup.ps1",
cred=ref(BP_CRED_cred_citrix),
target=ref(Service1),
target_endpoint=Endpoint.use_existing(poshendpoint),
)
Expected behavior
Expecting the task dependencies and sequence to be the same as when created in the GUI versus with DSL.
** System Configuration:**
- Calm VM 3.6.0
- DSL current master https://github.com/nutanix/calm-dsl/tree/e753678950dedb8e176099a587c353c00fab1d47
Abhijeet Singh Kaurav commented
@sohammehta23 is working on it
Abhijeet Singh Kaurav commented
Fixed in release 3.7.0