From 4388ed0f1bb59b2957d5f93de1e14a7cda097142 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Fri, 18 Oct 2024 17:45:37 +0200 Subject: [PATCH] Added correct exception type to service_multi on assign --- server/src/uds/core/exceptions/services.py | 5 ----- server/src/uds/services/PhysicalMachines/service_multi.py | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/server/src/uds/core/exceptions/services.py b/server/src/uds/core/exceptions/services.py index 0626a2cc6..9709ac42d 100644 --- a/server/src/uds/core/exceptions/services.py +++ b/server/src/uds/core/exceptions/services.py @@ -37,11 +37,6 @@ from .common import UDSException # Import for reference as "services.generics" from . import services_generics as generics # pyright: ignore[reportUnusedImport] -class InsufficientResourcesException(UDSException): - """ - Exception used to indicate that we have not enough resources to provide a service - """ - if typing.TYPE_CHECKING: from uds.models import UserService, Transport from uds.core.types.services import ReadyStatus diff --git a/server/src/uds/services/PhysicalMachines/service_multi.py b/server/src/uds/services/PhysicalMachines/service_multi.py index dc2e68d4c..c0e63d231 100644 --- a/server/src/uds/services/PhysicalMachines/service_multi.py +++ b/server/src/uds/services/PhysicalMachines/service_multi.py @@ -182,7 +182,7 @@ class IPMachinesService(services.Service): if server.locked_until is None or server.locked_until < sql_now(): server.lock(self.get_max_lock_time()) return server.uuid - raise exceptions.services.InsufficientResourcesException() + raise exceptions.services.MaxServicesReachedError() def get_host_mac(self, server_uuid: str) -> typing.Tuple[str, str]: server = models.Server.objects.get(uuid=server_uuid)