From d4812883fcdc3b8bcd8962297e4d390d70b9f6cf Mon Sep 17 00:00:00 2001 From: Plamen Dimitrov Date: Thu, 14 Nov 2024 00:06:59 +0200 Subject: [PATCH] Provide remote Pyro5 compatibility for multiple remote objects This is a more rarely used case that we could cover with Pyro5 support as well. The advertised method remains in retrieving multiple remote objects one by one using single remote object getter and this one remains more manual and requiring of control file implementation. Signed-off-by: Plamen Dimitrov --- aexpect/remote_door.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aexpect/remote_door.py b/aexpect/remote_door.py index 923ed3e..7eb3086 100644 --- a/aexpect/remote_door.py +++ b/aexpect/remote_door.py @@ -77,6 +77,7 @@ from Pyro5 import server # noinspection PyPackageRequirements from Pyro5 import nameserver + ns_module = "Pyro5.nameserver" except ImportError: # noinspection PyPackageRequirements,PyUnresolvedReferences import Pyro4 @@ -92,6 +93,7 @@ def __init__(self): # noinspection PyPackageRequirements from Pyro4 import naming as nameserver nameserver.start_ns = nameserver.startNS + ns_module = "Pyro4.naming" except ImportError: logging.warning("Remote object backend (Pyro4) not found, some functionality" @@ -848,7 +850,7 @@ def share_remote_objects(session, control_path, host="localhost", port=9090, # setup remote objects server LOG.info("Starting nameserver for the remote objects") - cmd = f"python -m Pyro4.naming -n {host} -p {port}" + cmd = f"python -m {ns_module} -n {host} -p {port}" session.cmd("START " + cmd if os_type == "windows" else cmd + " &") LOG.info("Starting the server daemon for the remote objects")