From: Kamoltat (Junior) Sirivadhna Date: Tue, 30 Jul 2019 14:39:56 +0000 (-0400) Subject: qa/tasks/mgr/test_progress.py: resolve dictionary runtime error X-Git-Tag: v15.1.0~1924^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F29385%2Fhead;p=ceph.git 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 --- 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)