From: vsr Date: Thu, 24 Oct 2019 12:19:05 +0000 (+0300) Subject: #17872 [CEA] /tmp/.salome_PortManager.lock permission denied (rollback two last commi... X-Git-Tag: V9_4_0rc1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c8e83f27f36e3c28d42746ea783a9f6591453261;p=modules%2Fkernel.git #17872 [CEA] /tmp/.salome_PortManager.lock permission denied (rollback two last commits as the fix does not work) --- diff --git a/bin/PortManager.py b/bin/PortManager.py index 9c8974d18..0b8dd94c1 100644 --- a/bin/PortManager.py +++ b/bin/PortManager.py @@ -83,14 +83,6 @@ def _getConfigurationFilename(): import tempfile temp = tempfile.NamedTemporaryFile() lock_file = os.path.join(os.path.dirname(temp.name), ".salome_PortManager.lock") - try: - oldmask = os.umask(0) - with open(lock_file, 'wb'): - pass - except IOError: - pass - finally: - os.umask(oldmask) temp.close() return (portmanager_config, lock_file) @@ -145,7 +137,7 @@ def getPort(preferredPort=None): config_file, lock_file = _getConfigurationFilename() oldmask = os.umask(0) - with open(lock_file, 'rb') as lock: + with open(lock_file, 'wb') as lock: # acquire lock __acquire_lock(lock) @@ -204,7 +196,7 @@ def releasePort(port): config_file, lock_file = _getConfigurationFilename() oldmask = os.umask(0) - with open(lock_file, 'rb') as lock: + with open(lock_file, 'wb') as lock: # acquire lock __acquire_lock(lock) @@ -247,7 +239,7 @@ def releasePort(port): def getBusyPorts(): config_file, lock_file = _getConfigurationFilename() oldmask = os.umask(0) - with open(lock_file, 'rb') as lock: + with open(lock_file, 'wb') as lock: # acquire lock __acquire_lock(lock)