Restrained mode now do not allows new machines to be created even on

user demand
This commit is contained in:
Adolfo Gómez García 2019-05-14 11:54:06 +02:00
parent 41b849c1f5
commit 20ff8cafdc
2 changed files with 3 additions and 2 deletions

View File

@ -277,6 +277,9 @@ class UserServiceManager(object):
if assignedUserService is not None:
return assignedUserService
if ds.isRestrained():
raise InvalidServiceException(_('The requested service is restrained'))
# Now try to locate 1 from cache already "ready" (must be usable and at level 1)
with transaction.atomic():
cache = ds.cachedUserServices().select_for_update().filter(cache_level=services.UserDeployment.L1_CACHE, state=State.USABLE, os_state=State.USABLE)[:1]

View File

@ -97,8 +97,6 @@ urlpatterns = [
# Downloader
re_path(r'^uds/utility/download/(?P<idDownload>[a-zA-Z0-9-]*)$', uds.web.views.download, name='utility.downloader'),
re_path(r'^uds/utility/files/(?P<uuid>.+)', uds.web.views.file_storage, name='utility.file_storage'),
# WEB API path (not REST api, frontend)
re_path(r'^uds/webapi/img/transport/(?P<idTrans>[a-zA-Z0-9-]+)$', uds.web.views.transportIcon, name='webapi.transportIcon'),
re_path(r'^uds/webapi/img/gallery/(?P<idImage>[a-zA-Z0-9-]+)$', uds.web.views.image, name='webapi.galleryImage'),