From 04bbc9dce2b82309071b55be05eede8cc7a5ec57 Mon Sep 17 00:00:00 2001 From: Karel van Klink <karel.vanklink@geant.org> Date: Thu, 5 Oct 2023 16:40:13 +0200 Subject: [PATCH] remove import typing --- lso/routes/ip_trunk.py | 12 +++++------- lso/routes/router.py | 3 +-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lso/routes/ip_trunk.py b/lso/routes/ip_trunk.py index 8798cbc..8aaad4d 100644 --- a/lso/routes/ip_trunk.py +++ b/lso/routes/ip_trunk.py @@ -1,6 +1,5 @@ """Routes for handling events related to the IP trunk service.""" from os import path -from typing import Optional from fastapi import APIRouter from pydantic import BaseModel, HttpUrl @@ -30,7 +29,7 @@ class IPTrunkProvisioningParams(IPTrunkParams): #: Whether this playbook execution should be a dry run, or run for real. Defaults to ``True`` for obvious reasons, #: also making it an optional parameter. - dry_run: Optional[bool] = True + dry_run: bool | None = True #: The type of object that is changed. object: str @@ -40,7 +39,7 @@ class IPTrunkModifyParams(IPTrunkParams): #: Whether this playbook execution should be a dry run, or run for real. Defaults to ``True`` for obvious reasons, #: also making it an optional parameter. - dry_run: Optional[bool] = True + dry_run: bool | None = True #: The old subscription object, represented as a dictionary. This allows #: for calculating the difference in subscriptions. old_subscription: dict @@ -51,7 +50,7 @@ class IPTrunkMigrationParams(IPTrunkParams): #: Whether this playbook execution should be a dry run, or run for real. Defaults to ``True`` for obvious reasons, #: also making it an optional parameter. - dry_run: Optional[bool] = True + dry_run: bool | None = True #: The new Router that this IP Trunk is migrating to. new_side: dict #: An Ansible playbook verb that is passed along for indicating the phase of the migration that is performed. @@ -72,7 +71,7 @@ class IPTrunkDeleteParams(IPTrunkParams): #: Whether this playbook execution should be a dry run, or run for real. Defaults to ``True`` for obvious reasons, #: also making it an optional parameter. - dry_run: Optional[bool] = True + dry_run: bool | None = True @router.post("/") @@ -217,8 +216,7 @@ def migrate_ip_trunk(params: IPTrunkMigrationParams) -> PlaybookLaunchResponse: "verb": params.verb, "config_object": params.config_object, "dry_run": str(params.dry_run), - "commit_comment": f"GSO_PROCESS_ID: {params.process_id} " - f"- TT_NUMBER: {params.tt_number}" + "commit_comment": f"GSO_PROCESS_ID: {params.process_id} - TT_NUMBER: {params.tt_number}" f"- Deploy config for {params.subscription['iptrunk']['geant_s_sid']} ", } diff --git a/lso/routes/router.py b/lso/routes/router.py index b9895c3..5737d47 100644 --- a/lso/routes/router.py +++ b/lso/routes/router.py @@ -1,6 +1,5 @@ """Routes for handling device/base_config-related requests.""" import os -from typing import Optional from fastapi import APIRouter from pydantic import BaseModel, HttpUrl @@ -29,7 +28,7 @@ class NodeProvisioningParams(BaseModel): subscription: dict #: Whether this playbook execution should be a dry run, or run for real. Defaults to ``True`` for obvious reasons, #: also making it an optional parameter. - dry_run: Optional[bool] = True + dry_run: bool | None = True #: Trouble Ticket number that is associated with the deployment. tt_number: str #: The process ID generated by workflow orchestrator, used for the commit comment in the routers. -- GitLab