From: Anthony Geay Date: Sun, 12 Sep 2021 05:14:56 +0000 (+0200) Subject: Fix bug switch to SSL mode for Odyssee X-Git-Tag: V9_8_0a1~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8379c072fb01244c37ac02d0e86913ebe7f1e059;p=modules%2Fkernel.git Fix bug switch to SSL mode for Odyssee --- diff --git a/src/KERNEL_PY/__init__.py b/src/KERNEL_PY/__init__.py index 21ae93f65..1a3af63bc 100644 --- a/src/KERNEL_PY/__init__.py +++ b/src/KERNEL_PY/__init__.py @@ -370,7 +370,7 @@ def salome_walk_on_containers(ns,root): pass pass -def salome_shutdown_containers(): +def salome_shutdown_containers_with_session(): salome_init() ns=salome_NS() li = [elt for elt in salome_walk_on_containers(ns,[""])] @@ -383,6 +383,22 @@ def salome_shutdown_containers(): ref_in_ns = "/".join(root+[cont_name]) naming_service.Destroy_Name(ref_in_ns) print("Number of containers in NS after clean : {}".format( len( list(salome_walk_on_containers(ns,[""])) ))) + +def salome_shutdown_containers_without_session(): + containersEntries = [elt for elt in naming_service.repr() if "/Containers/" == elt[:12]] + for containerEntry in containersEntries: + cont = naming_service.Resolve(containerEntry) + try: + cont.Shutdown() + except: + pass + +def salome_shutdown_containers(): + import KernelBasis + if KernelBasis.getSSLMode(): + salome_shutdown_containers_without_session() + else: + salome_shutdown_containers_with_session() class SessionContextManager: def __enter__(self):