diff --git a/gso/utils/workflow_steps.py b/gso/utils/workflow_steps.py index 1f87a2fa72dea2501a8d23de8a36940639a4300c..9a8a14dd5b2c60ebf372828cbbcdc0e3612d0821 100644 --- a/gso/utils/workflow_steps.py +++ b/gso/utils/workflow_steps.py @@ -11,19 +11,19 @@ from gso.products.product_types.iptrunk import Iptrunk from gso.services.provisioning_proxy import execute_playbook -@step("[DRY RUN] Deploy base config") -def deploy_base_config_dry( +def _deploy_base_config( subscription: dict[str, Any], tt_number: str, callback_route: str, process_id: UUIDstr, -) -> State: - """Perform a dry run of provisioning base config on a router.""" + *, + dry_run: bool, +) -> None: inventory = subscription["router"]["router_fqdn"] extra_vars = { "wfo_router_json": subscription, - "dry_run": True, + "dry_run": dry_run, "verb": "deploy", "commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - Deploy base config", } @@ -35,6 +35,17 @@ def deploy_base_config_dry( extra_vars=extra_vars, ) + +@step("[DRY RUN] Deploy base config") +def deploy_base_config_dry( + subscription: dict[str, Any], + tt_number: str, + callback_route: str, + process_id: UUIDstr, +) -> State: + """Perform a dry run of provisioning base config on a router.""" + _deploy_base_config(subscription, tt_number, callback_route, process_id, dry_run=True) + return {"subscription": subscription} @@ -46,21 +57,7 @@ def deploy_base_config_real( process_id: UUIDstr, ) -> State: """Deploy base config on a router using the provisioning proxy.""" - inventory = subscription["router"]["router_fqdn"] - - extra_vars = { - "wfo_router_json": subscription, - "dry_run": False, - "verb": "deploy", - "commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - Deploy base config", - } - - execute_playbook( - playbook_name="base_config.yaml", - callback_route=callback_route, - inventory=inventory, - extra_vars=extra_vars, - ) + _deploy_base_config(subscription, tt_number, callback_route, process_id, dry_run=False) return {"subscription": subscription}