From 1322f90a43b0b06c5225f174c6f53c2f8ac908c0 Mon Sep 17 00:00:00 2001 From: "Kamoltat (Junior) Sirivadhna" Date: Tue, 30 Jul 2019 10:39:56 -0400 Subject: [PATCH] qa/tasks/mgr/test_progress.py: resolve dictionary runtime error Think the problem is how we are using dictionary.item() in for loop causing runtime error therefore the event didn't get created so we convert it to list(dictionary). Fixes http://pulpito.ceph.com/kchai-2019-07-28_14:30:09-rados-wip-kefu2-testing-2019-07-28-1941-distro-basic-mira/4160881/ Also the same fix as: #28840 Signed-off-by: Kamoltat (Junior) Sirivadhna --- src/pybind/mgr/progress/module.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/progress/module.py b/src/pybind/mgr/progress/module.py index 255f4d0b9118..4caa47d2cd52 100644 --- a/src/pybind/mgr/progress/module.py +++ b/src/pybind/mgr/progress/module.py @@ -433,7 +433,8 @@ class Module(MgrModule): # In the case of the osd coming back in, we might need to cancel # previous recovery event for that osd if marked == "in": - for ev_id, ev in self._events.items(): + for ev_id in list(self._events): + ev = self.events[ev_id] if isinstance(ev, PgRecoveryEvent) and osd_id in ev.which_osds: self.log.info("osd.{0} came back in, cancelling event".format( osd_id @@ -486,7 +487,8 @@ class Module(MgrModule): self._osdmap_changed(old_osdmap, self._latest_osdmap) elif notify_type == "pg_summary": data = self.get("pg_dump") - for ev_id, ev in self._events.items(): + for ev_id in list(self._events): + ev = self._events[ev_id] if isinstance(ev, PgRecoveryEvent): ev.pg_update(data, self.log) self.maybe_complete(ev) -- 2.47.3