]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/mgr/test_progress.py: resolve dictionary runtime error 29385/head
authorKamoltat (Junior) Sirivadhna <ksirivad@redhat.com>
Tue, 30 Jul 2019 14:39:56 +0000 (10:39 -0400)
committerKamoltat (Junior) Sirivadhna <ksirivad@redhat.com>
Mon, 5 Aug 2019 15:06:33 +0000 (11:06 -0400)
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 <ksirivad@redhat.com>
src/pybind/mgr/progress/module.py

index 255f4d0b9118fa2728573f97a681761e750c6ef4..4caa47d2cd52c0e685da3c5f6ba7e262bb4e768f 100644 (file)
@@ -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)