mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-04 05:17:54 +03:00
Refactor variable names in user_service_status function and ProxmoxClient
This commit is contained in:
parent
1a7a4865af
commit
fa24a5e4f4
@ -145,7 +145,7 @@ class Client(Handler):
|
|||||||
'Res: %s',
|
'Res: %s',
|
||||||
info
|
info
|
||||||
)
|
)
|
||||||
password = CryptoManager().symmetric_decrypt(data['password'], scrambler)
|
password = CryptoManager.manager().symmetric_decrypt(data['password'], scrambler)
|
||||||
|
|
||||||
# userService.setConnectionSource(srcIp, hostname) # Store where we are accessing from so we can notify Service
|
# userService.setConnectionSource(srcIp, hostname) # Store where we are accessing from so we can notify Service
|
||||||
if not info.ip:
|
if not info.ip:
|
||||||
@ -193,10 +193,10 @@ class Client(Handler):
|
|||||||
"""
|
"""
|
||||||
logger.debug('Client args for GET: %s', self._args)
|
logger.debug('Client args for GET: %s', self._args)
|
||||||
|
|
||||||
def error() -> None:
|
def _error() -> None:
|
||||||
raise exceptions.rest.RequestError('Invalid request')
|
raise exceptions.rest.RequestError('Invalid request')
|
||||||
|
|
||||||
def noargs() -> dict[str, typing.Any]:
|
def _noargs() -> dict[str, typing.Any]:
|
||||||
return Client.result(
|
return Client.result(
|
||||||
{
|
{
|
||||||
'availableVersion': CLIENT_VERSION, # Compat with old clients, TB removed soon...
|
'availableVersion': CLIENT_VERSION, # Compat with old clients, TB removed soon...
|
||||||
@ -210,8 +210,8 @@ class Client(Handler):
|
|||||||
|
|
||||||
return match(
|
return match(
|
||||||
self._args,
|
self._args,
|
||||||
error, # In case of error, raises RequestError
|
_error, # In case of error, raises RequestError
|
||||||
((), noargs), # No args, return version
|
((), _noargs), # No args, return version
|
||||||
(('test',), self.test), # Test request, returns "Correct"
|
(('test',), self.test), # Test request, returns "Correct"
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
|
@ -70,7 +70,7 @@ class PropertyAccessor:
|
|||||||
try:
|
try:
|
||||||
p = self._filter().get(key=key)
|
p = self._filter().get(key=key)
|
||||||
p.value = value
|
p.value = value
|
||||||
p.save()
|
p.save(update_fields=['value'])
|
||||||
except Properties.DoesNotExist:
|
except Properties.DoesNotExist:
|
||||||
Properties.objects.create(owner_id=self.owner_id, owner_type=self.owner_type, key=key, value=value)
|
Properties.objects.create(owner_id=self.owner_id, owner_type=self.owner_type, key=key, value=value)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user