diff --git a/gso/products/product_types/edge_port.py b/gso/products/product_types/edge_port.py index 372e15045b9d2d953cbba06e0e0d01db071f1cb5..417b6047a8d787d852057b43d52692a38569bc32 100644 --- a/gso/products/product_types/edge_port.py +++ b/gso/products/product_types/edge_port.py @@ -40,4 +40,3 @@ class ImportedEdgePort( """An imported Edge Port that is currently active.""" edge_port: EdgePortBlock - diff --git a/gso/workflows/nren_l3_core_service/import_nren_l3_core_service.py b/gso/workflows/nren_l3_core_service/import_nren_l3_core_service.py index af458e54baa51499b15a5b97df66f6f7ec4a50ad..4d314997abbc681dcc814019619c8520c8bc1266 100644 --- a/gso/workflows/nren_l3_core_service/import_nren_l3_core_service.py +++ b/gso/workflows/nren_l3_core_service/import_nren_l3_core_service.py @@ -7,7 +7,7 @@ from orchestrator.workflows.steps import resync, store_process_subscription, uns from orchestrator.workflows.utils import wrap_modify_initial_input_form from gso.products import ProductName -from gso.products.product_types.nren_l3_core_service import NRENL3CoreService, ImportedNRENL3CoreService +from gso.products.product_types.nren_l3_core_service import ImportedNRENL3CoreService, NRENL3CoreService from gso.services.subscriptions import get_product_id_by_name diff --git a/gso/workflows/nren_l3_core_service/migrate_nren_l3_core_service.py b/gso/workflows/nren_l3_core_service/migrate_nren_l3_core_service.py index 0ab0f28d70efd7a898a6b3311be177a4dab94c8a..5d42bccdad3a97ec0f4dc52b2b1d720ab89192e5 100644 --- a/gso/workflows/nren_l3_core_service/migrate_nren_l3_core_service.py +++ b/gso/workflows/nren_l3_core_service/migrate_nren_l3_core_service.py @@ -1,4 +1,4 @@ -"""A modification workflow that migrates a GÉANT IP subscription to a different set of Edge Ports.""" +"""A modification workflow that migrates a L3 Core Service to a new set of Edge Ports.""" from typing import Annotated @@ -20,14 +20,14 @@ from gso.utils.types.tt_number import TTNumber def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator: - """Gather input from the operator on what new Edge Ports this GÉANT IP should migrate to.""" + """Gather input from the operator on what new Edge Ports this L3 Core Service should be migrated to.""" subscription = NRENL3CoreService.from_subscription(subscription_id) partner_id = subscription.customer_id - edge_port_count = len(subscription.geant_ip.geant_ip_ap_list) + edge_port_count = len(subscription.nren_l3_core_service.nren_ap_list) def _new_edge_port_selector(pid: UUIDstr) -> Choice: existing_ep_name_list = [ - ap.geant_ip_sbp.edge_port.owner_subscription_id for ap in subscription.geant_ip.geant_ip_ap_list + ap.sbp.edge_port.owner_subscription_id for ap in subscription.nren_l3_core_service.nren_ap_list ] edge_port_subscriptions = list( filter( @@ -55,7 +55,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator: return edge_ports class NRENL3CoreServiceEdgePortSelectionForm(FormPage): - model_config = ConfigDict(title="Migrating GÉANT IP to a new set of Edge Ports") + model_config = ConfigDict(title=f"Migrating {subscription.product.name} to a new set of Edge Ports") tt_number: TTNumber divider: Divider = Field(None, exclude=True) @@ -65,12 +65,12 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator: Len(min_length=edge_port_count, max_length=edge_port_count), ] = [ # noqa: RUF012 NewEdgePortSelection( - old_edge_port=f"{ - EdgePort.from_subscription(ap.geant_ip_sbp.edge_port.owner_subscription_id).description - } ({ap.nren_ap_type})", + old_edge_port=f"{EdgePort.from_subscription(ap.sbp.edge_port.owner_subscription_id).description} ({ + ap.ap_type + })", new_edge_port="", ) - for ap in subscription.geant_ip.geant_ip_ap_list + for ap in subscription.nren_l3_core_service.nren_ap_list ] ep_user_input = yield NRENL3CoreServiceEdgePortSelectionForm @@ -82,7 +82,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator: def update_subscription_model(subscription: NRENL3CoreService, edge_port_selection: list[dict]) -> State: """Update the subscription model with the new list of Access Ports.""" for index, selected_port in enumerate(edge_port_selection): - subscription.geant_ip.geant_ip_ap_list[index].geant_ip_sbp.edge_port = EdgePort.from_subscription( + subscription.nren_l3_core_service.nren_ap_list[index].sbp.edge_port = EdgePort.from_subscription( selected_port["new_edge_port"] ).edge_port @@ -90,10 +90,10 @@ def update_subscription_model(subscription: NRENL3CoreService, edge_port_selecti @workflow( - "Migrate GÉANT IP", + "Migrate NREN L3 Core Service", initial_input_form=wrap_modify_initial_input_form(initial_input_form_generator), target=Target.MODIFY, ) def migrate_nren_l3_core_service() -> StepList: - """Migrate a GÉANT IP to a new set of Edge Ports.""" + """Migrate a :term:`NREN` L3 Core Service to a new set of Edge Ports.""" return begin >> store_process_subscription(Target.MODIFY) >> unsync >> update_subscription_model >> resync >> done diff --git a/gso/workflows/nren_l3_core_service/modify_nren_l3_core_service.py b/gso/workflows/nren_l3_core_service/modify_nren_l3_core_service.py index 97f538205f215ada2d4259f748f729b8f4964399..12c809b7d80c94ee894a2867ccdbc18643eae25a 100644 --- a/gso/workflows/nren_l3_core_service/modify_nren_l3_core_service.py +++ b/gso/workflows/nren_l3_core_service/modify_nren_l3_core_service.py @@ -125,7 +125,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator: class BindingPortModificationForm(FormPage): model_config = ConfigDict( title=f"{product_name} - Modify Edge Port configuration " - f"({access_port_index + 1}/{len(input_ap_list)})" + f"({access_port_index + 1}/{len(input_ap_list)})" ) current_ep_label: Label = Field( f"Currently configuring on {access_port.sbp.edge_port.edge_port_description} " diff --git a/test/fixtures/geant_ip_fixtures.py b/test/fixtures/geant_ip_fixtures.py index cf7a83840a1d98b081a9efb090aa17841b3fe021..cb8649663bdbbe0d57c8dbc090ec38d8e7183a5a 100644 --- a/test/fixtures/geant_ip_fixtures.py +++ b/test/fixtures/geant_ip_fixtures.py @@ -10,7 +10,7 @@ from gso.products import EdgePort, ProductName from gso.products.product_blocks.bgp_session import BGPSession, IPFamily from gso.products.product_blocks.nren_l3_core_service import NRENAccessPort from gso.products.product_blocks.service_binding_port import ServiceBindingPort -from gso.products.product_types.nren_l3_core_service import NRENL3CoreServiceInactive, ImportedNRENL3CoreService +from gso.products.product_types.nren_l3_core_service import ImportedNRENL3CoreService, NRENL3CoreServiceInactive from gso.services import subscriptions from gso.utils.shared_enums import APType, SBPType from gso.utils.types.ip_address import IPAddress