Skip to content
Snippets Groups Projects
Commit 0e6acfa8 authored by Aleksandr Kurbatov's avatar Aleksandr Kurbatov
Browse files

`workflow_steps` - SDP functions reworked

parent d9442f98
No related branches found
No related tags found
1 merge request!399Rework of SDP steps
...@@ -50,11 +50,7 @@ def _deploy_base_config( ...@@ -50,11 +50,7 @@ def _deploy_base_config(
def _update_sdp_mesh( def _update_sdp_mesh(
subscription: dict[str, Any], subscription: dict[str, Any], tt_number: str, process_id: UUIDstr, *, dry_run: bool, verb: str
tt_number: str,
process_id: UUIDstr,
*,
dry_run: bool,
) -> LSOState: ) -> LSOState:
inventory = generate_inventory_for_routers( inventory = generate_inventory_for_routers(
router_role=RouterRole.PE, router_vendor=Vendor.NOKIA, exclude_routers=[subscription["router"]["router_fqdn"]] router_role=RouterRole.PE, router_vendor=Vendor.NOKIA, exclude_routers=[subscription["router"]["router_fqdn"]]
...@@ -65,7 +61,7 @@ def _update_sdp_mesh( ...@@ -65,7 +61,7 @@ def _update_sdp_mesh(
"subscription": subscription, "subscription": subscription,
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - " "commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - "
f"Update the SDP mesh for L2circuits(epipes) config on PE NOKIA routers", f"Update the SDP mesh for L2circuits(epipes) config on PE NOKIA routers",
"verb": "update_sdp_mesh", "verb": verb,
"pe_router_list": { "pe_router_list": {
subscription["router"]["router_fqdn"]: { subscription["router"]["router_fqdn"]: {
"lo4": str(subscription["router"]["router_lo_ipv4_address"]), "lo4": str(subscription["router"]["router_lo_ipv4_address"]),
...@@ -93,7 +89,7 @@ def _update_sdp_single_pe( ...@@ -93,7 +89,7 @@ def _update_sdp_single_pe(
"subscription": subscription, "subscription": subscription,
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - " "commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - "
f"Update the SDP mesh for L2circuits(epipes) config on PE NOKIA routers", f"Update the SDP mesh for L2circuits(epipes) config on PE NOKIA routers",
"verb": "update_sdp_mesh", "verb": "add_pe_to_sdp_mesh",
"pe_router_list": generate_inventory_for_routers( "pe_router_list": generate_inventory_for_routers(
router_role=RouterRole.PE, router_role=RouterRole.PE,
exclude_routers=[subscription["router"]["router_fqdn"]], exclude_routers=[subscription["router"]["router_fqdn"]],
...@@ -288,15 +284,27 @@ def add_pe_mesh_to_pe_real(subscription: dict[str, Any], tt_number: str, process ...@@ -288,15 +284,27 @@ def add_pe_mesh_to_pe_real(subscription: dict[str, Any], tt_number: str, process
@step("[DRY RUN] Include the PE into SDP mesh on other Nokia PEs") @step("[DRY RUN] Include the PE into SDP mesh on other Nokia PEs")
def update_sdp_mesh_dry(subscription: dict[str, Any], tt_number: str, process_id: UUIDstr) -> State: def add_pe_to_sdp_mesh_dry(subscription: dict[str, Any], tt_number: str, process_id: UUIDstr) -> State:
"""Perform a dry run of including new PE router in SDP mesh on other NOKIA PE routers."""
return _update_sdp_mesh(subscription, tt_number, process_id, dry_run=True, verb="add_pe_to_sdp_mesh")
@step("[FOR REAL] Include the PE into SDP mesh on other Nokia PEs")
def add_pe_to_sdp_mesh_real(subscription: dict[str, Any], tt_number: str, process_id: UUIDstr) -> State:
"""Perform a real run of including new PE router in SDP mesh on other NOKIA PE routers."""
return _update_sdp_mesh(subscription, tt_number, process_id, dry_run=False, verb="add_pe_to_sdp_mesh")
@step("[DRY RUN] Include the PE into SDP mesh on other Nokia PEs")
def remove_pe_from_sdp_mesh_dry(subscription: dict[str, Any], tt_number: str, process_id: UUIDstr) -> State:
"""Perform a dry run of including new PE router in SDP mesh on other NOKIA PE routers.""" """Perform a dry run of including new PE router in SDP mesh on other NOKIA PE routers."""
return _update_sdp_mesh(subscription, tt_number, process_id, dry_run=True) return _update_sdp_mesh(subscription, tt_number, process_id, dry_run=True, verb="remove_pe_from_sdp_mesh")
@step("[FOR REAL] Include the PE into SDP mesh on other Nokia PEs") @step("[FOR REAL] Include the PE into SDP mesh on other Nokia PEs")
def update_sdp_mesh_real(subscription: dict[str, Any], tt_number: str, process_id: UUIDstr) -> State: def remove_pe_from_sdp_mesh_real(subscription: dict[str, Any], tt_number: str, process_id: UUIDstr) -> State:
"""Perform a real run of including new PE router in SDP mesh on other NOKIA PE routers.""" """Perform a real run of including new PE router in SDP mesh on other NOKIA PE routers."""
return _update_sdp_mesh(subscription, tt_number, process_id, dry_run=False) return _update_sdp_mesh(subscription, tt_number, process_id, dry_run=False, verb="remove_pe_from_sdp_mesh")
@step("[DRY RUN] Configure SDP on the PE to all other Nokia PEs") @step("[DRY RUN] Configure SDP on the PE to all other Nokia PEs")
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment