mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-10 01:17:59 +03:00
Merge remote-tracking branch 'origin/v3.6'
This commit is contained in:
commit
a19629bd0e
@ -216,7 +216,7 @@ class ForwardThread(threading.Thread):
|
||||
class SubHandler(Handler):
|
||||
chain_host = self.redirectHost
|
||||
chain_port = self.redirectPort
|
||||
ssh_transport = self.client.get_transport()
|
||||
ssh_transport = self.client.get_transport() # type: ignore
|
||||
event = self.stopEvent
|
||||
thread = self
|
||||
|
||||
|
@ -91,7 +91,7 @@ class ServiceCacheUpdater(Job):
|
||||
for servicePool in servicePoolsNeedingCaching:
|
||||
servicePool.userServices.update() # Cleans cached queries
|
||||
# If this deployedService don't have a publication active and needs it, ignore it
|
||||
spServiceInstance = servicePool.service.getInstance()
|
||||
spServiceInstance = servicePool.service.getInstance() # type: ignore
|
||||
|
||||
if (
|
||||
servicePool.activePublication() is None
|
||||
@ -140,7 +140,7 @@ class ServiceCacheUpdater(Job):
|
||||
)
|
||||
inAssigned: int = (
|
||||
servicePool.assignedUserServices()
|
||||
.filter(userServiceManager().getStateFilter(servicePool.service))
|
||||
.filter(userServiceManager().getStateFilter(servicePool.service)) # type: ignore
|
||||
.count()
|
||||
)
|
||||
# if we bypasses max cache, we will reduce it in first place. This is so because this will free resources on service provider
|
||||
|
@ -38,7 +38,7 @@ from django.http import HttpResponse
|
||||
from django.views.decorators.cache import cache_page, never_cache
|
||||
|
||||
from uds.core.auths.auth import webLoginRequired, webPassword
|
||||
from uds.core.managers import userServiceManager
|
||||
from uds.core.managers.user_service import UserServiceManager
|
||||
from uds.core.ui.images import DEFAULT_IMAGE
|
||||
from uds.core.util.model import processUuid
|
||||
from uds.models import Transport, Image
|
||||
@ -66,7 +66,7 @@ def transportOwnLink(
|
||||
|
||||
# For type checkers to "be happy"
|
||||
try:
|
||||
res = userServiceManager().getService(
|
||||
res = UserServiceManager().getService(
|
||||
request.user, request.os, request.ip, idService, idTransport
|
||||
)
|
||||
ip, userService, iads, trans, itrans = res
|
||||
@ -164,12 +164,12 @@ def userServiceStatus(
|
||||
userService: typing.Optional['UserService'] = None
|
||||
status = 'running'
|
||||
# If service exists (meta or not)
|
||||
if userServiceManager().isMetaService(idService):
|
||||
userService = userServiceManager().locateMetaService(
|
||||
if UserServiceManager().isMetaService(idService):
|
||||
userService = UserServiceManager().locateMetaService(
|
||||
user=request.user, idService=idService
|
||||
)
|
||||
else:
|
||||
userService = userServiceManager().locateUserService(
|
||||
userService = UserServiceManager().locateUserService(
|
||||
user=request.user, idService=idService, create=False
|
||||
)
|
||||
if userService:
|
||||
@ -198,11 +198,11 @@ def userServiceStatus(
|
||||
def action(
|
||||
request: 'ExtendedHttpRequestWithUser', idService: str, actionString: str
|
||||
) -> HttpResponse:
|
||||
userService = userServiceManager().locateMetaService(
|
||||
userService = UserServiceManager().locateMetaService(
|
||||
request.user, idService
|
||||
)
|
||||
if not userService:
|
||||
userService = userServiceManager().locateUserService(
|
||||
userService = UserServiceManager().locateUserService(
|
||||
request.user, idService, create=False
|
||||
)
|
||||
|
||||
@ -222,12 +222,12 @@ def action(
|
||||
),
|
||||
log.WEB,
|
||||
)
|
||||
userServiceManager().requestLogoff(userService)
|
||||
UserServiceManager().requestLogoff(userService)
|
||||
userService.release()
|
||||
elif (
|
||||
actionString == 'reset'
|
||||
and userService.deployed_service.allow_users_reset
|
||||
and userService.deployed_service.service.getType().canReset
|
||||
and userService.deployed_service.service.getType().canReset # type: ignore
|
||||
):
|
||||
rebuild = True
|
||||
log.doLog(
|
||||
@ -238,8 +238,8 @@ def action(
|
||||
),
|
||||
log.WEB,
|
||||
)
|
||||
# userServiceManager().requestLogoff(userService)
|
||||
userServiceManager().reset(userService)
|
||||
# UserServiceManager().requestLogoff(userService)
|
||||
UserServiceManager().reset(userService)
|
||||
|
||||
|
||||
if rebuild:
|
||||
|
Loading…
Reference in New Issue
Block a user