diff --git a/gso/workflows/router/validate_router.py b/gso/workflows/router/validate_router.py index 38f6c4b6e9269ff482abc542271ba256deb4fd62..884170ce9b5537533821fb2b0ba8af06e8d2720f 100644 --- a/gso/workflows/router/validate_router.py +++ b/gso/workflows/router/validate_router.py @@ -100,6 +100,34 @@ def verify_pe_mesh_in_pe(subscription: dict[str, Any]) -> LSOState: } +@step("Verify SDP mesh on the PE router") +def verify_sdp_single_pe(subscription: dict[str, Any]) -> LSOState: + """Verify SDP mesh on the PE router.""" + extra_vars = { + "dry_run": True, + "subscription": subscription, + "verb": "add_pe_to_sdp_mesh", + "pe_router_list": generate_inventory_for_routers( + router_role=RouterRole.PE, + exclude_routers=[subscription["router"]["router_fqdn"]], + )["all"]["hosts"], + "is_verification_workflow": "true", + } + + if not extra_vars["pe_router_list"]: + return { + "playbook_name": "", + "inventory": {"all": {"hosts": {}}}, + "extra_vars": {}, + } + + return { + "playbook_name": "gap_ansible/playbooks/update_pe_sdp_mesh.yaml", + "inventory": {"all": {"hosts": {subscription["router"]["router_fqdn"]: None}}}, + "extra_vars": extra_vars, + } + + @step("Verify PE BGP P-ONLY neighbors") def verify_all_p_in_pe(subscription: dict[str, Any]) -> LSOState: """Verify P neighbors in `P-ONLY` group on a PE router.""" @@ -173,7 +201,7 @@ def check_kentik_entry_exists(subscription: Router) -> None: raise ProcessFailureError( message="Device in Kentik incorrectly configured", details=f"Kentik device {subscription.router.router_fqdn} has the archiving license " - f"{archive_plan["name"]} applied to it, despite the existence of active layer 3 services.", + f"{archive_plan['name']} applied to it, despite the existence of active layer 3 services.", ) placeholder_plan = client.get_plan_by_name(kentik_params.placeholder_license_key) @@ -181,7 +209,7 @@ def check_kentik_entry_exists(subscription: Router) -> None: raise ProcessFailureError( message="Device in Kentik incorrectly configured", details=f"Kentik device {subscription.router.router_fqdn} has the placeholder license " - f"{placeholder_plan["name"]} applied to it, despite the existence of active layer 3 services.", + f"{placeholder_plan['name']} applied to it, despite the existence of active layer 3 services.", ) @@ -231,7 +259,8 @@ def validate_router() -> StepList: >> anonymous_lso_interaction(verify_base_config) >> is_p_router(anonymous_lso_interaction(verify_p_ibgp)) >> is_pe_router(anonymous_lso_interaction(verify_pe_mesh_in_pe)) - >> is_pe_router(anonymous_lso_interaction(verify_all_p_in_pe)) + >> is_pe_router(anonymous_lso_interaction(verify_sdp_single_pe)) + # >> is_pe_router(anonymous_lso_interaction(verify_all_p_in_pe)) >> resync >> done )