From c29d90aa5f665fecaae30f27ffabc87ef4527c87 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 30 Sep 2022 14:35:30 -0400 Subject: [PATCH] Island: Use list comprehension instead of list(map()) --- monkey/monkey_island/cc/repository/mongo_node_repository.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/monkey_island/cc/repository/mongo_node_repository.py b/monkey/monkey_island/cc/repository/mongo_node_repository.py index 5b1b7f71f..9b994d110 100644 --- a/monkey/monkey_island/cc/repository/mongo_node_repository.py +++ b/monkey/monkey_island/cc/repository/mongo_node_repository.py @@ -73,7 +73,7 @@ class MongoNodeRepository(INodeRepository): def get_nodes(self) -> Sequence[Node]: try: cursor = self._nodes_collection.find({}, {MONGO_OBJECT_ID_KEY: False}) - return list(map(lambda n: Node(**n), cursor)) + return [Node(**n) for n in cursor] except Exception as err: raise RetrievalError(f"Error retrieving nodes from the repository: {err}")