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:
parent
f7d10a4f4b
commit
4388ed0f1b
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user