From 4c5fca2522ed2297ee94139163f61c29c976c549 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Mon, 13 Feb 2023 09:40:43 +0100 Subject: [PATCH] [EDF26936] : helper for test purpose --- src/KERNEL_PY/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/KERNEL_PY/__init__.py b/src/KERNEL_PY/__init__.py index 8c05dbac6..c3bd7fbec 100644 --- a/src/KERNEL_PY/__init__.py +++ b/src/KERNEL_PY/__init__.py @@ -411,9 +411,12 @@ def salome_shutdown_containers_with_session(): 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 retrieve_containers_in_ns(): + return [elt for elt in naming_service.repr() if "/Containers/" == elt[:12]] def salome_shutdown_containers_without_session(): - containersEntries = [elt for elt in naming_service.repr() if "/Containers/" == elt[:12]] + containersEntries = retrieve_containers_in_ns() for containerEntry in containersEntries: cont = naming_service.Resolve(containerEntry) try: -- 2.39.2