]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
#17872 [CEA] /tmp/.salome_PortManager.lock permission denied (rollback two last commi...
authorvsr <vsr@opencascade.com>
Thu, 24 Oct 2019 12:19:05 +0000 (15:19 +0300)
committervsr <vsr@opencascade.com>
Thu, 24 Oct 2019 12:19:05 +0000 (15:19 +0300)
bin/PortManager.py

index 9c8974d18ae2a6eb0c48919650fae38b65440394..0b8dd94c1ff79654328f583d1c518bb57572a481 100644 (file)
@@ -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)