1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-22 13:34:04 +03:00

Added correct exception type to service_multi on assign

This commit is contained in:
Adolfo Gómez García 2024-10-18 17:45:37 +02:00
parent f7d10a4f4b
commit 4388ed0f1b
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23
2 changed files with 1 additions and 6 deletions

View File

@ -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

View File

@ -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)