Skip to content
Snippets Groups Projects

`promote_p_to_pe`: update in `add_all_p_to_pe`

Merged Aleksandr Kurbatov requested to merge fix/promote-p-to-pe into develop
1 file
+ 16
8
Compare changes
  • Side-by-side
  • Inline
@@ -440,7 +440,7 @@ def update_subscription_model(subscription: Router) -> State:
@@ -440,7 +440,7 @@ def update_subscription_model(subscription: Router) -> State:
return {"subscription": subscription}
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:
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."""
"""Perform a dry run of adding all P routers to the PE router."""
extra_vars = {
extra_vars = {
@@ -448,7 +448,9 @@ def add_all_p_to_pe_dry(subscription: dict[str, Any], callback_route: str, tt_nu
@@ -448,7 +448,9 @@ def add_all_p_to_pe_dry(subscription: dict[str, Any], callback_route: str, tt_nu
"subscription": subscription,
"subscription": subscription,
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - Add all P-routers to this new PE",
"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",
"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(
lso_client.execute_playbook(
@@ -459,7 +461,7 @@ def add_all_p_to_pe_dry(subscription: dict[str, Any], callback_route: str, tt_nu
@@ -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(
def add_all_p_to_pe_real(
subscription: dict[str, Any], callback_route: str, tt_number: str, process_id: UUIDstr
subscription: dict[str, Any], callback_route: str, tt_number: str, process_id: UUIDstr
) -> None:
) -> None:
@@ -469,7 +471,9 @@ def add_all_p_to_pe_real(
@@ -469,7 +471,9 @@ def add_all_p_to_pe_real(
"subscription": subscription,
"subscription": subscription,
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - Add all P-routers to this new PE",
"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",
"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(
lso_client.execute_playbook(
@@ -480,7 +484,7 @@ def add_all_p_to_pe_real(
@@ -480,7 +484,7 @@ def add_all_p_to_pe_real(
)
)
@step("[DRY RUN] Add PE to all P")
@step("[DRY RUN] Add this new PE to all P")
def add_pe_to_all_p_dry(subscription: dict[str, Any], callback_route: str, tt_number: str, process_id: UUIDstr) -> None:
def add_pe_to_all_p_dry(subscription: dict[str, Any], callback_route: str, tt_number: str, process_id: UUIDstr) -> None:
"""Perform a dry run of adding promoted router to all PE routers in iGEANT/iGEANT6."""
"""Perform a dry run of adding promoted router to all PE routers in iGEANT/iGEANT6."""
extra_vars = {
extra_vars = {
@@ -494,12 +498,14 @@ def add_pe_to_all_p_dry(subscription: dict[str, Any], callback_route: str, tt_nu
@@ -494,12 +498,14 @@ def add_pe_to_all_p_dry(subscription: dict[str, Any], callback_route: str, tt_nu
lso_client.execute_playbook(
lso_client.execute_playbook(
playbook_name="update_ibgp_mesh.yaml",
playbook_name="update_ibgp_mesh.yaml",
callback_route=callback_route,
callback_route=callback_route,
inventory=generate_inventory_for_active_routers(RouterRole.P),
inventory=generate_inventory_for_active_routers(
 
RouterRole.P, exclude_routers=[subscription["router"]["router_fqdn"]]
 
),
extra_vars=extra_vars,
extra_vars=extra_vars,
)
)
@step("[FOR REAL] Add PE to all P")
@step("[FOR REAL] Add this new PE to all P")
def add_pe_to_all_p_real(
def add_pe_to_all_p_real(
subscription: dict[str, Any], callback_route: str, tt_number: str, process_id: UUIDstr
subscription: dict[str, Any], callback_route: str, tt_number: str, process_id: UUIDstr
) -> None:
) -> None:
@@ -515,7 +521,9 @@ def add_pe_to_all_p_real(
@@ -515,7 +521,9 @@ def add_pe_to_all_p_real(
lso_client.execute_playbook(
lso_client.execute_playbook(
playbook_name="update_ibgp_mesh.yaml",
playbook_name="update_ibgp_mesh.yaml",
callback_route=callback_route,
callback_route=callback_route,
inventory=generate_inventory_for_active_routers(RouterRole.P),
inventory=generate_inventory_for_active_routers(
 
RouterRole.P, exclude_routers=[subscription["router"]["router_fqdn"]]
 
),
extra_vars=extra_vars,
extra_vars=extra_vars,
)
)
Loading