diff --git a/gso/utils/helpers.py b/gso/utils/helpers.py index a5c1bc9dc3571ea651cada274b12e461d23c2886..c20e8a4e780daff69688fa1b83b7cf57787ce99a 100644 --- a/gso/utils/helpers.py +++ b/gso/utils/helpers.py @@ -325,8 +325,8 @@ def generate_unique_vc_id(l2c_type: str, max_attempts: int = 100) -> VC_ID | Non def create_vc_id() -> str: """Generate an 8-digit VC_ID starting with '11'.""" if l2c_type == Layer2CircuitType.ETHERNET: - return str(random.randint(30001, 39999)) # noqa: S311 - return str(random.randint(6000, 6999)) # noqa: S311 + return str(random.randint(30001, 39999)) + return str(random.randint(6000, 6999)) for _ in range(max_attempts): vc_id = create_vc_id() diff --git a/gso/workflows/edge_port/migrate_edge_port.py b/gso/workflows/edge_port/migrate_edge_port.py index afd2d6d0f46e9dd6a81f9fe1e290af0ff3b217d0..ecdabd6f3460343249e98b59bd87557514ebdeb5 100644 --- a/gso/workflows/edge_port/migrate_edge_port.py +++ b/gso/workflows/edge_port/migrate_edge_port.py @@ -292,7 +292,7 @@ def migrate_l3_core_services_to_new_node(subscription_id: UUIDstr, tt_number: TT }, ], ], - countdown=random.choice([2, 3, 4, 5]), # noqa: S311 + countdown=random.choice([2, 3, 4, 5]), ) return {"l3_core_services": l3_core_services} @@ -319,7 +319,7 @@ def migrate_l2_circuits_to_new_node(subscription_id: UUIDstr, tt_number: TTNumbe }, ], ], - countdown=random.choice([2, 3, 4, 5]), # noqa: S311 + countdown=random.choice([2, 3, 4, 5]), ) return {"layer2_circuits": layer2_circuits} diff --git a/pyproject.toml b/pyproject.toml index 6fb91172edfe7f78200037184ba51e1f77cad78f..34e477ffd71d29f1bd31b5d2ea0282e99d0ed05a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,6 +46,7 @@ ignore = [ "PLR0913", "PLR0904", "PLW1514", + "S311", ] select = [ "A", diff --git a/test/fixtures/l3_core_service_fixtures.py b/test/fixtures/l3_core_service_fixtures.py index bffe03dae1e11dfe8e06e5b2cd4bd02543cc4627..fc72ca3998ccec8c03e893f4178c452fbabf6e6f 100644 --- a/test/fixtures/l3_core_service_fixtures.py +++ b/test/fixtures/l3_core_service_fixtures.py @@ -133,7 +133,7 @@ def access_port_factory(faker, service_binding_port_factory): ): return AccessPort.new( subscription_id=uuid4(), - ap_type=ap_type or random.choice(list(APType)), # noqa: S311 + ap_type=ap_type or random.choice(list(APType)), sbp=service_binding_port or service_binding_port_factory(edge_port=edge_port, partner=partner), )