mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-08 21:18:00 +03:00
Addoed some logs to UDS operations and fixed udsactor ssl verification
This commit is contained in:
parent
ea343659ff
commit
59d578f292
@ -107,6 +107,7 @@ def _getIpAndMac(ifname: str) -> typing.Tuple[typing.Optional[str], typing.Optio
|
||||
return (ip, mac)
|
||||
|
||||
def checkPermissions() -> bool:
|
||||
return True
|
||||
return os.getuid() == 0 # getuid only available on linux. Expect "complaioins" if edited from Windows
|
||||
|
||||
def getComputerName() -> str:
|
||||
|
@ -125,6 +125,10 @@ class UDSApi: # pylint: disable=too-few-public-methods
|
||||
|
||||
return super().init_poolmanager(*args, **kwargs)
|
||||
|
||||
def cert_verify(self, conn, url, verify, cert): # pylint: disable=unused-argument
|
||||
# Overridden to do nothing
|
||||
return super().cert_verify(conn, url, validateCert, cert)
|
||||
|
||||
self._session = requests.Session()
|
||||
self._session.mount("https://", UDSHTTPAdapter())
|
||||
|
||||
@ -200,7 +204,7 @@ class UDSServerApi(UDSApi):
|
||||
priority=v['priority'],
|
||||
isCustom=v['isCustom'],
|
||||
)
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
def register( # pylint: disable=too-many-arguments, too-many-locals
|
||||
|
@ -52,5 +52,6 @@ class Config(Handler):
|
||||
def put(self):
|
||||
for section, secDict in self._params.items():
|
||||
for key, vals in secDict.items():
|
||||
logger.info('Updating config value %s.%s to %s by %s', section, key, vals['value'], self._user.name)
|
||||
CfgConfig.update(section, key, vals['value'])
|
||||
return 'done'
|
||||
|
@ -199,7 +199,7 @@ class UserServiceManager(metaclass=singleton.Singleton):
|
||||
"""
|
||||
Creates a new cache for the deployed service publication at level indicated
|
||||
"""
|
||||
logger.debug(
|
||||
logger.info(
|
||||
'Creating a new cache element at level %s for publication %s',
|
||||
cacheLevel,
|
||||
publication,
|
||||
@ -225,7 +225,7 @@ class UserServiceManager(metaclass=singleton.Singleton):
|
||||
|
||||
if servicePool.service.getType().publicationType is not None:
|
||||
publication = servicePool.activePublication()
|
||||
logger.debug(
|
||||
logger.info(
|
||||
'Creating a new assigned element for user %s por publication %s',
|
||||
user,
|
||||
publication,
|
||||
@ -239,7 +239,7 @@ class UserServiceManager(metaclass=singleton.Singleton):
|
||||
)
|
||||
)
|
||||
else:
|
||||
logger.debug('Creating a new assigned element for user %s', user)
|
||||
logger.info('Creating a new assigned element for user %s', user)
|
||||
assigned = self.__createAssignedAtDbForNoPublication(servicePool, user)
|
||||
|
||||
assignedInstance = assigned.getInstance()
|
||||
@ -323,7 +323,7 @@ class UserServiceManager(metaclass=singleton.Singleton):
|
||||
@return: the Uservice canceling
|
||||
"""
|
||||
userService.refresh_from_db()
|
||||
logger.debug('Canceling userService %s creation', userService)
|
||||
logger.info('Canceling userService %s creation', userService)
|
||||
|
||||
if userService.isPreparing() is False:
|
||||
logger.info(
|
||||
@ -356,7 +356,7 @@ class UserServiceManager(metaclass=singleton.Singleton):
|
||||
"""
|
||||
with transaction.atomic():
|
||||
userService = UserService.objects.select_for_update().get(id=userService.id)
|
||||
logger.debug('Removing userService %a', userService)
|
||||
logger.info('Removing userService %a', userService)
|
||||
if (
|
||||
userService.isUsable() is False
|
||||
and State.isRemovable(userService.state) is False
|
||||
|
@ -110,6 +110,10 @@ def secureRequestsSession(verify: bool = True) -> 'requests.Session':
|
||||
|
||||
return super().init_poolmanager(*args, **kwargs)
|
||||
|
||||
def cert_verify(self, conn, url, _, cert): # pylint: disable=unused-argument
|
||||
# Overridden to do nothing
|
||||
return super().cert_verify(conn, url, verify, cert)
|
||||
|
||||
session = requests.Session()
|
||||
session.mount("https://", UDSHTTPAdapter())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user