diff --git a/labgrid/remote/coordinator.py b/labgrid/remote/coordinator.py index 635c7c5c9..97ed16d26 100644 --- a/labgrid/remote/coordinator.py +++ b/labgrid/remote/coordinator.py @@ -194,7 +194,7 @@ def __init__(self) -> None: self.clients: dict[str, ClientSession] = {} self.load() - self.loop = asyncio.get_event_loop() + self.loop = asyncio.get_running_loop() self.poll_task = self.loop.create_task(self.poll()) async def _poll_step(self): @@ -1025,7 +1025,9 @@ def main(): logging.basicConfig(level=logging.DEBUG if args.debug else logging.INFO) - loop = asyncio.get_event_loop() + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) + cleanup = [] loop.set_debug(True) try: diff --git a/labgrid/remote/exporter.py b/labgrid/remote/exporter.py index 64ddb4032..95d331e90 100755 --- a/labgrid/remote/exporter.py +++ b/labgrid/remote/exporter.py @@ -778,7 +778,7 @@ def __init__(self, config) -> None: - Setup loop, name, authid and address - Join the coordinator as an exporter""" self.config = config - self.loop = asyncio.get_event_loop() + self.loop = asyncio.get_running_loop() self.name = config["name"] self.hostname = config["hostname"] self.isolated = config["isolated"] @@ -1061,6 +1061,9 @@ def main(): print(f"exporter hostname: {config['hostname']}") print(f"resource config file: {config['resources']}") + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) + asyncio.run(amain(config), debug=bool(args.debug)) if reexec: