diff --git a/gso/products/product_blocks/iptrunk.py b/gso/products/product_blocks/iptrunk.py index e72828ba24babbe3f7750271b9310cb8265a78d0..89f54e7211a0974e97b18ee63e51c42b2ea7c7df 100644 --- a/gso/products/product_blocks/iptrunk.py +++ b/gso/products/product_blocks/iptrunk.py @@ -19,7 +19,7 @@ class IptrunkType(strEnum): T = TypeVar("T", covariant=True) -class IptrunkSides(UniqueConstrainedList[T]): # type: ignore +class IptrunkSides(UniqueConstrainedList[T]): # type: ignore[type-var] min_items = 2 max_items = 2 diff --git a/gso/services/provisioning_proxy.py b/gso/services/provisioning_proxy.py index d135823666c5ce2263fa6184fcb34d5f016ee343..c96ef37b1b3f3beb76418e8ecf46a4a2f28238cb 100644 --- a/gso/services/provisioning_proxy.py +++ b/gso/services/provisioning_proxy.py @@ -247,8 +247,8 @@ def _await_pp_results(subscription: SubscriptionModel, label_text: str = DEFAULT class Config: title = f"Deploying {subscription.product.name}..." - warning_label: Label = label_text # type: ignore - pp_run_results: dict = None # type: ignore + warning_label: Label = label_text # type: ignore[assignment] + pp_run_results: dict = None # type: ignore[assignment] confirm: Accept = Accept("INCOMPLETE") @validator("pp_run_results", allow_reuse=True, pre=True, always=True) @@ -299,14 +299,15 @@ def _confirm_pp_results(state: State) -> FormGenerator: if not successful_run: pp_retry_label1: Label = ( - "Provisioning Proxy - playbook execution failed: inspect the output before proceeding" # type: ignore + "Provisioning Proxy - playbook execution failed: " + "inspect the output before proceeding" # type: ignore[assignment] ) run_status: str = ReadOnlyField(state["pp_run_results"]["status"]) run_results: LongText = ReadOnlyField(json.dumps(state["pp_run_results"]["output"], indent=4)) if not successful_run: pp_retry_label: Label = ( - "Click submit to retry. Otherwise, abort the workflow from the process tab." # type: ignore + "Click submit to retry. Otherwise, abort the workflow from the process tab." # type: ignore[assignment] ) yield ConfirmRunPage diff --git a/gso/workflows/iptrunk/create_iptrunk.py b/gso/workflows/iptrunk/create_iptrunk.py index 4e2203114f96b8bfc5e7d3bddbf8119b8aa08491..ae2c8cf9301e1e634d3695c8b5078c834705970d 100644 --- a/gso/workflows/iptrunk/create_iptrunk.py +++ b/gso/workflows/iptrunk/create_iptrunk.py @@ -30,7 +30,7 @@ def initial_input_form_generator(product_name: str) -> FormGenerator: title = product_name tt_number: str - customer: customer_selector() # type: ignore + customer: customer_selector() # type: ignore[valid-type] geant_s_sid: str iptrunk_description: str iptrunk_type: IptrunkType @@ -42,13 +42,13 @@ def initial_input_form_generator(product_name: str) -> FormGenerator: class AeMembersListA(UniqueConstrainedList[str]): min_items = initial_user_input.iptrunk_minimum_links - RouterEnumA = Choice("Select a router", zip(routers.keys(), routers.items())) # type: ignore + RouterEnumA = Choice("Select a router", zip(routers.keys(), routers.items())) # type: ignore[arg-type] class CreateIptrunkSideAForm(FormPage): class Config: title = "Provide subscription details for side A of the trunk." - iptrunk_sideA_node_id: RouterEnumA # type: ignore + iptrunk_sideA_node_id: RouterEnumA # type: ignore[valid-type] iptrunk_sideA_ae_iface: str iptrunk_sideA_ae_geant_a_sid: str iptrunk_sideA_ae_members: AeMembersListA @@ -58,7 +58,7 @@ def initial_input_form_generator(product_name: str) -> FormGenerator: # Remove the selected router for side A, to prevent any loops routers.pop(str(user_input_side_a.iptrunk_sideA_node_id.name)) - RouterEnumB = Choice("Select a router", zip(routers.keys(), routers.items())) # type: ignore + RouterEnumB = Choice("Select a router", zip(routers.keys(), routers.items())) # type: ignore[arg-type] class AeMembersListB(UniqueConstrainedList[str]): min_items = len(user_input_side_a.iptrunk_sideA_ae_members) @@ -68,7 +68,7 @@ def initial_input_form_generator(product_name: str) -> FormGenerator: class Config: title = "Provide subscription details for side B of the trunk." - iptrunk_sideB_node_id: RouterEnumB # type: ignore + iptrunk_sideB_node_id: RouterEnumB # type: ignore[valid-type] iptrunk_sideB_ae_iface: str iptrunk_sideB_ae_geant_a_sid: str iptrunk_sideB_ae_members: AeMembersListB diff --git a/gso/workflows/iptrunk/migrate_iptrunk.py b/gso/workflows/iptrunk/migrate_iptrunk.py index 8b9fc6b4f2ec02a7cb1846efabc7caaa64cda085..b492606b5641274d94f26bb90ef88f9152af9ceb 100644 --- a/gso/workflows/iptrunk/migrate_iptrunk.py +++ b/gso/workflows/iptrunk/migrate_iptrunk.py @@ -31,7 +31,8 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator: } ReplacedSide = Choice( - "Select the side of the IP trunk to be replaced", zip(sides_dict.keys(), sides_dict.items()) # type: ignore + "Select the side of the IP trunk to be replaced", + zip(sides_dict.keys(), sides_dict.items()), # type: ignore[arg-type] ) class OldSideIptrunkForm(FormPage): @@ -44,8 +45,8 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator: ) tt_number: str - replace_side: ReplacedSide # type: ignore - warning_label: Label = "Are we moving to a different Site?" # type: ignore + replace_side: ReplacedSide # type: ignore[valid-type] + warning_label: Label = "Are we moving to a different Site?" # type: ignore[assignment] migrate_to_different_site: Optional[bool] = False old_side_input = yield OldSideIptrunkForm @@ -73,7 +74,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator: continue routers[str(router_id)] = router_description - NewRouterEnum = Choice("Select a new router", zip(routers.keys(), routers.items())) # type: ignore + NewRouterEnum = Choice("Select a new router", zip(routers.keys(), routers.items())) # type: ignore[arg-type] class LagMemberList(UniqueConstrainedList[str]): min_items = len(subscription.iptrunk.iptrunk_sides[0].iptrunk_side_ae_members) @@ -87,7 +88,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator: f"{subscription.iptrunk.iptrunk_sides[1].iptrunk_side_node.router_fqdn}" ) - new_node: NewRouterEnum # type: ignore + new_node: NewRouterEnum # type: ignore[valid-type] new_lag_interface: str new_lag_member_interfaces: LagMemberList @@ -241,7 +242,8 @@ def confirm_continue_move_fiber() -> FormGenerator: title = "Please confirm before continuing" info_label: Label = ( - "New Trunk interface has been deployed, wait for the physical connection to be moved" # type: ignore + "New Trunk interface has been deployed, " + "wait for the physical connection to be moved." # type: ignore[assignment] ) yield ProvisioningResultPage @@ -303,7 +305,7 @@ def confirm_continue_restore_isis() -> FormGenerator: title = "Please confirm before continuing" info_label: Label = ( - "ISIS config has been deployed, confirm if you want to restore the old metric" # type: ignore + "ISIS config has been deployed, confirm if you want to restore the old metric." # type: ignore[assignment] ) yield ProvisioningResultPage diff --git a/gso/workflows/iptrunk/modify_trunk_interface.py b/gso/workflows/iptrunk/modify_trunk_interface.py index 5e588c0c300651f6fe9d83b1b6b824800828037e..87e3b8f52108b4dca6fd6f4aaba81127f6a3a2e4 100644 --- a/gso/workflows/iptrunk/modify_trunk_interface.py +++ b/gso/workflows/iptrunk/modify_trunk_interface.py @@ -23,7 +23,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator: geant_s_sid: str = subscription.iptrunk.geant_s_sid iptrunk_description: str = subscription.iptrunk.iptrunk_description iptrunk_type: IptrunkType = subscription.iptrunk.iptrunk_type - iptrunk_speed: PhyPortCapacity = subscription.iptrunk.iptrunk_speed # type: ignore + iptrunk_speed: PhyPortCapacity = subscription.iptrunk.iptrunk_speed # type: ignore[assignment] iptrunk_minimum_links: int = subscription.iptrunk.iptrunk_minimum_links iptrunk_isis_metric: int = ReadOnlyField(subscription.iptrunk.iptrunk_isis_metric) iptrunk_ipv4_network: ipaddress.IPv4Network = ReadOnlyField(subscription.iptrunk.iptrunk_ipv4_network) diff --git a/gso/workflows/iptrunk/terminate_iptrunk.py b/gso/workflows/iptrunk/terminate_iptrunk.py index 8ee23423c18395fe21eac186f301aebcb921a6c5..b2310d89c9d1851f168e9c2521fc0052c0c3b74c 100644 --- a/gso/workflows/iptrunk/terminate_iptrunk.py +++ b/gso/workflows/iptrunk/terminate_iptrunk.py @@ -18,7 +18,7 @@ def initial_input_form_generator() -> FormGenerator: class TerminateForm(FormPage): termination_label: Label = ( "Please confirm whether configuration should get removed from the A and B sides of the trunk, and whether " - "IPAM resources should be released." # type: ignore + "IPAM resources should be released." # type: ignore[assignment] ) tt_number: str remove_configuration: bool = True diff --git a/gso/workflows/router/create_router.py b/gso/workflows/router/create_router.py index 7e022acd774b7ffd0c0cafdaf6cfea0238daa380..be23b4159398d38f8255fdd0584a66add973717e 100644 --- a/gso/workflows/router/create_router.py +++ b/gso/workflows/router/create_router.py @@ -28,7 +28,7 @@ def _site_selector() -> Choice: site_subscriptions[str(site_id)] = site_description # noinspection PyTypeChecker - return Choice("Select a site", zip(site_subscriptions.keys(), site_subscriptions.items())) # type: ignore + return Choice("Select a site", zip(site_subscriptions.keys(), site_subscriptions.items())) # type: ignore[arg-type] def initial_input_form_generator(product_name: str) -> FormGenerator: @@ -37,8 +37,8 @@ def initial_input_form_generator(product_name: str) -> FormGenerator: title = product_name tt_number: str - customer: customer_selector() # type: ignore - router_site: _site_selector() # type: ignore + customer: customer_selector() # type: ignore[valid-type] + router_site: _site_selector() # type: ignore[valid-type] hostname: str ts_port: PortNumber router_vendor: RouterVendor diff --git a/gso/workflows/router/terminate_router.py b/gso/workflows/router/terminate_router.py index 5d4c405eabdfc7a91da11fd4e56f6ec1d3f428e2..413e84b901994da275bad375433fbf5024cbe956 100644 --- a/gso/workflows/router/terminate_router.py +++ b/gso/workflows/router/terminate_router.py @@ -21,7 +21,7 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator: class TerminateForm(FormPage): termination_label: Label = ( "Please confirm whether configuration should get removed from the router, and whether IPAM resources should" - " be released." # type: ignore + " be released." # type: ignore[assignment] ) tt_number: str remove_configuration: bool = True diff --git a/gso/workflows/site/create_site.py b/gso/workflows/site/create_site.py index e495049ec17ba041d4aa7248e308a8e60c3939f2..edcb7a01acfdf9cc5620ac4b95a27e90d4afb72d 100644 --- a/gso/workflows/site/create_site.py +++ b/gso/workflows/site/create_site.py @@ -21,7 +21,7 @@ def initial_input_form_generator(product_name: str) -> FormGenerator: # noqa: C class Config: title = product_name - customer: customer_selector() # type: ignore + customer: customer_selector() # type: ignore[valid-type] site_name: str site_city: str site_country: str diff --git a/gso/workflows/tasks/import_iptrunk.py b/gso/workflows/tasks/import_iptrunk.py index db4cb347446b56ac15f0592635e2afc4414cb1c3..f1c3e6cf03612892b08848a6deb5b0a67a0beba3 100644 --- a/gso/workflows/tasks/import_iptrunk.py +++ b/gso/workflows/tasks/import_iptrunk.py @@ -29,7 +29,7 @@ def _generate_routers() -> dict[str, str]: def initial_input_form_generator() -> FormGenerator: routers = _generate_routers() - RouterEnum = Choice("Select a router", zip(routers.keys(), routers.items())) # type: ignore + RouterEnum = Choice("Select a router", zip(routers.keys(), routers.items())) # type: ignore[arg-type] class CreateIptrunkForm(FormPage): class Config: @@ -42,13 +42,13 @@ def initial_input_form_generator() -> FormGenerator: iptrunk_speed: PhyPortCapacity iptrunk_minimum_links: int - iptrunk_sideA_node_id: RouterEnum # type: ignore + iptrunk_sideA_node_id: RouterEnum # type: ignore[valid-type] iptrunk_sideA_ae_iface: str iptrunk_sideA_ae_geant_a_sid: str iptrunk_sideA_ae_members: UniqueConstrainedList[str] iptrunk_sideA_ae_members_descriptions: UniqueConstrainedList[str] - iptrunk_sideB_node_id: RouterEnum # type: ignore + iptrunk_sideB_node_id: RouterEnum # type: ignore[valid-type] iptrunk_sideB_ae_iface: str iptrunk_sideB_ae_geant_a_sid: str iptrunk_sideB_ae_members: UniqueConstrainedList[str] diff --git a/gso/workflows/utils.py b/gso/workflows/utils.py index 453fbea26f89284aa53a64fb13f534779cdbd683..02ebed3eaf5a12f55027063b30728ac4a8336ca1 100644 --- a/gso/workflows/utils.py +++ b/gso/workflows/utils.py @@ -11,7 +11,7 @@ def customer_selector() -> Choice: for customer in all_customers(): customers[customer["id"]] = customer["name"] - return Choice("Select a customer", zip(customers.keys(), customers.items())) # type: ignore + return Choice("Select a customer", zip(customers.keys(), customers.items())) # type: ignore[arg-type] def iso_from_ipv4(ipv4_address: IPv4Address) -> str: