diff --git a/gso/workflows/router/promote_p_to_pe.py b/gso/workflows/router/promote_p_to_pe.py index 74f478c075e615900ea5e3a8c0e996aca94b364c..edd673d76ca68199564db5572f1ae597b1ba6e50 100644 --- a/gso/workflows/router/promote_p_to_pe.py +++ b/gso/workflows/router/promote_p_to_pe.py @@ -440,7 +440,7 @@ def update_subscription_model(subscription: Router) -> State: return {"subscription": subscription} -@step("[DRY RUN] Add all P to PE") +@step("[DRY RUN] Add all P to this new PE") def add_all_p_to_pe_dry(subscription: dict[str, Any], callback_route: str, tt_number: str, process_id: UUIDstr) -> None: """Perform a dry run of adding all P routers to the PE router.""" extra_vars = { @@ -448,7 +448,9 @@ def add_all_p_to_pe_dry(subscription: dict[str, Any], callback_route: str, tt_nu "subscription": subscription, "commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - Add all P-routers to this new PE", "verb": "add_all_p_to_pe", - "p_router_list": generate_inventory_for_active_routers(RouterRole.P)["all"]["hosts"], + "p_router_list": generate_inventory_for_active_routers( + RouterRole.P, exclude_routers=[subscription["router"]["router_fqdn"]] + )["all"]["hosts"], } lso_client.execute_playbook( @@ -459,7 +461,7 @@ def add_all_p_to_pe_dry(subscription: dict[str, Any], callback_route: str, tt_nu ) -@step("[FOR REAL] Add all P to PE") +@step("[FOR REAL] Add all P to this new PE") def add_all_p_to_pe_real( subscription: dict[str, Any], callback_route: str, tt_number: str, process_id: UUIDstr ) -> None: @@ -469,7 +471,9 @@ def add_all_p_to_pe_real( "subscription": subscription, "commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - Add all P-routers to this new PE", "verb": "add_all_p_to_pe", - "p_router_list": generate_inventory_for_active_routers(RouterRole.P)["all"]["hosts"], + "p_router_list": generate_inventory_for_active_routers( + RouterRole.P, exclude_routers=[subscription["router"]["router_fqdn"]] + )["all"]["hosts"], } lso_client.execute_playbook(