]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
[EDF29576] : WIP
authorAnthony Geay <anthony.geay@edf.fr>
Mon, 26 Feb 2024 10:32:39 +0000 (11:32 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Mon, 26 Feb 2024 10:32:39 +0000 (11:32 +0100)
src/Container/Container_i.cxx
src/KERNEL_PY/__init__.py
src/NamingService/NamingService.i

index 872e161ab7c5e9ba19a203975d59d6c4e4cf7166..547ce7f401f98f013f6a4a42afbb445809db5ca0 100644 (file)
@@ -734,7 +734,7 @@ void Abstract_Engines_Container_i::Shutdown()
     }
   }
   _listInstances_map.clear();
-
+  MESSAGE("Engines_Container_i::Shutdown() -- step 2");
   // NS unregistering may throw in SSL mode if master process hosting SALOME_Embedded_NamingService servant has vanished
   // In this case it's skip it and still continue.
   try
@@ -745,13 +745,20 @@ void Abstract_Engines_Container_i::Shutdown()
   catch(...)
   {
   }
-  //
-  this->cleanAllPyScripts();
-  //
+  MESSAGE("Engines_Container_i::Shutdown() -- step 3");
+  try
+  {
+    this->cleanAllPyScripts();
+    //
+    {
+      AutoGIL gstate;
+      AutoPyRef result = PyObject_CallMethod(_pyCont, (char*)"shutdownPy", (char*)"",nullptr);
+    }
+  }
+  catch(...)
   {
-    AutoGIL gstate;
-    AutoPyRef result = PyObject_CallMethod(_pyCont, (char*)"shutdownPy", (char*)"",nullptr);
   }
+  MESSAGE("Engines_Container_i::Shutdown() -- step 4");
   //
   if(_isServantAloneInProcess)
   {
index 4446fdb60ec570d35123c2d53870428e71b98148..8e9e92b458d34eb91a74091f8cbc320e9b6522be 100644 (file)
@@ -283,6 +283,12 @@ def salome_init_without_session(path=None, embedded=False, iorfakensfile=None):
         with open(iorfakensfile,"w") as iorfakensf:
             iorfakensf.write(NamingService.IOROfNS())
     
+CM_NAME_IN_NS = "/ContainerManager"
+RM_NAME_IN_NS = "/ResourcesManager"
+DSM_NAME_IN_NS = "/DataServerManager"
+ESM_NAME_IN_NS = "/ExternalServers"
+LOGM_NAME_IN_NS = "/LogManager"
+
 def salome_init_without_session_attached(path=None, embedded=False):
     """
     Configuration SSL inside a python interpretor launched in the SALOME_Container_No_NS_Serv.
@@ -297,25 +303,20 @@ def salome_init_without_session_attached(path=None, embedded=False):
     import KernelBasis
     nsAbroad = orb.string_to_object( KernelBasis.getIOROfEmbeddedNS() )
     import SALOME
-    CM_NAME_IN_NS = "/ContainerManager"
     cm = orb.string_to_object( nsAbroad.Resolve(CM_NAME_IN_NS).decode() )
     type(cm).SetOverrideEnvForContainersSimple = ContainerManagerSetOverrideEnvForContainersSimple
     naming_service.Register(cm,CM_NAME_IN_NS)
-    RM_NAME_IN_NS = "/ResourcesManager"
     rm = orb.string_to_object( nsAbroad.Resolve(RM_NAME_IN_NS).decode() )
     naming_service.Register(rm,RM_NAME_IN_NS)
     #
     from LifeCycleCORBA import LifeCycleCORBASSL
     lcc = LifeCycleCORBASSL()
-    DSM_NAME_IN_NS = "/DataServerManager"
     dsm = orb.string_to_object( nsAbroad.Resolve(DSM_NAME_IN_NS).decode() )
     naming_service.Register(dsm,DSM_NAME_IN_NS)
     #
-    ESM_NAME_IN_NS = "/ExternalServers"
     esm = orb.string_to_object( nsAbroad.Resolve(ESM_NAME_IN_NS).decode() )
     naming_service.Register(esm,ESM_NAME_IN_NS)
     #
-    LOGM_NAME_IN_NS = "/LogManager"
     logm = orb.string_to_object( nsAbroad.Resolve(LOGM_NAME_IN_NS).decode() )
     naming_service.Register(logm,LOGM_NAME_IN_NS)
 
index f63aba017891063f716019945c158b5c3ec3df8d..308588a3fbf22d35cca8c1850ece109a049428d7 100644 (file)
@@ -141,6 +141,15 @@ def NamingService_DumpIORInFile(cls,iorFileName):
   with open( iorFileName, "w" ) as f:
     f.write( cls.IOROfNS() )
 NamingService.DumpIORInFile = classmethod(NamingService_DumpIORInFile)
+def NamingService_LoadIORInFile(cls,iorFileName):
+  import Engines
+  import CORBA
+  orb=CORBA.ORB_init([''])
+  with open( iorFileName ) as f:
+    ior = f.read()
+  ref = orb.string_to_object(ior)
+  return ref
+NamingService.LoadIORInFile = classmethod( NamingService_LoadIORInFile )
 def NamingService_KillContainersInFile(cls,logFileName):
   import Engines
   import CORBA