From 5386d7c40cdaef39a08b69fcce96467a5396c6ee Mon Sep 17 00:00:00 2001 From: XiaojueGuan Date: Fri, 3 May 2019 15:40:04 +0800 Subject: [PATCH] change function list_traces of mongodb module osprofiler fails when it is configed with mongon. the minimum version of pymongo osprofile requires is 3.0.2 and in this version and after when function list_traces is is invoked error will show described in the bug issue. Change-Id: I2510660c36aaa89117a97c67b4cb61fa3dade14d Closes-Bug: 1827480 --- osprofiler/drivers/mongodb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osprofiler/drivers/mongodb.py b/osprofiler/drivers/mongodb.py index 0ca1928..7713baf 100644 --- a/osprofiler/drivers/mongodb.py +++ b/osprofiler/drivers/mongodb.py @@ -81,7 +81,7 @@ class MongoDB(base.Driver): at least `base_id` and `timestamp`. """ fields = set(fields or self.default_trace_fields) - ids = self.db.profiler.find("*").distinct("base_id") + ids = self.db.profiler.find({}).distinct("base_id") out_format = {"base_id": 1, "timestamp": 1, "_id": 0} out_format.update({i: 1 for i in fields}) return [self.db.profiler.find(