From 3b6e4f531382e7c33153e4b5967f1a8626504779 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 30 Sep 2022 10:16:17 -0400 Subject: [PATCH] Island: Simplify cursor to agents --- monkey/monkey_island/cc/repository/mongo_agent_repository.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/monkey_island/cc/repository/mongo_agent_repository.py b/monkey/monkey_island/cc/repository/mongo_agent_repository.py index 9bf66e4bc..527426ee3 100644 --- a/monkey/monkey_island/cc/repository/mongo_agent_repository.py +++ b/monkey/monkey_island/cc/repository/mongo_agent_repository.py @@ -62,7 +62,7 @@ class MongoAgentRepository(IAgentRepository): def get_running_agents(self) -> Sequence[Agent]: try: cursor = self._agents_collection.find({"stop_time": None}, {MONGO_OBJECT_ID_KEY: False}) - return list(map(lambda a: Agent(**a), cursor)) + return [Agent(**a) for a in cursor] except Exception as err: raise RetrievalError(f"Error retrieving running agents: {err}")