From: vsr Date: Fri, 7 May 2021 09:55:40 +0000 (+0300) Subject: Fix problems of killing SALOME processes on Windows X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fd86d1d9a13378a45d488ffe83fd4cb562d36df9;p=modules%2Fkernel.git Fix problems of killing SALOME processes on Windows --- diff --git a/bin/killSalomeWithPort.py b/bin/killSalomeWithPort.py index a845475ce..d30d030b9 100755 --- a/bin/killSalomeWithPort.py +++ b/bin/killSalomeWithPort.py @@ -404,7 +404,7 @@ def __checkUnkilledProcesses(): def _checkUserName(_process): # The following is a workaround for Windows on which # psutil.Process().username() returns 'usergroup' + 'username' - return getUserName() == _process.username() + return getUserName() == _process.username().split('\\')[-1] def _getDictfromOutput(_processes, _wildcard=None): for _process in psutil.process_iter(['name', 'username']): diff --git a/bin/salome_utils.py b/bin/salome_utils.py index e919b2484..75770ea0d 100644 --- a/bin/salome_utils.py +++ b/bin/salome_utils.py @@ -451,7 +451,7 @@ def getOmniNamesPid(port): """ processes = {p.info['pid']: p.info['name'] for p in psutil.process_iter(['pid', 'name'])} return next((c.pid for c in psutil.net_connections(kind='inet') \ - if c.laddr.port == port and processes.get(c.pid) == 'omniNames'), None) + if c.laddr.port == port and processes.get(c.pid)).startswith('omniNames')), None) # -- def killOmniNames(port):