From 914d94e41ac274d4387455fd51b64822432be45b Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Tue, 5 Mar 2024 15:30:35 +0100 Subject: [PATCH] Fix: Caller expected tuple but got a single value When attempting to stop the pool, the `stop()` method expected a tuple `vm_hash, execution` while the function called to provide thos only returned an iterable of executions. Solution: Discard the `vm_hash`. --- src/aleph/vm/pool.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/aleph/vm/pool.py b/src/aleph/vm/pool.py index 0c1673cee..4de93920f 100644 --- a/src/aleph/vm/pool.py +++ b/src/aleph/vm/pool.py @@ -259,13 +259,11 @@ async def _load_persistent_executions(self): async def stop(self): """Stop ephemeral VMs in the pool.""" # Stop executions in parallel: - await asyncio.gather(*(execution.stop() for vm_hash, execution in self.get_ephemeral_executions())) + await asyncio.gather(*(execution.stop() for execution in self.get_ephemeral_executions())) def get_ephemeral_executions(self) -> Iterable[VmExecution]: executions = ( - execution - for _vm_hash, execution in self.executions.items() - if execution.is_running and not execution.persistent + execution for _, execution in self.executions.items() if execution.is_running and not execution.persistent ) return executions or []