]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
restful: Fix regression when traversing leaf nodes 26200/head
authorBoris Ranto <branto@redhat.com>
Thu, 14 Feb 2019 09:35:56 +0000 (10:35 +0100)
committerBoris Ranto <branto@redhat.com>
Thu, 14 Feb 2019 11:10:22 +0000 (12:10 +0100)
The commit 23b6c90 introduced a regression when traversing leaf nodes.
The issue is that it traverses the keys of a `dict` returned by
`nodes_by_id`, not the actual `items` of the node. That resulted in an
500 error because it tried to treat `str` as a `dict` and failed.

Signed-off-by: Boris Ranto <branto@redhat.com>
(cherry picked from commit fb51bad963cc649fb12ca0ed8b738a2e819299b6)

src/pybind/mgr/restful/common.py

index 2ca482d581d6ecff9bf8d0243fcf20f9bbfd84d3..2c1ffddaea35c32c2685f63dd2cfe9ac6cf991e2 100644 (file)
@@ -142,7 +142,7 @@ def crush_rule_osds(node_buckets, rule):
                 if node_id >= 0:
                     osds.add(node_id)
                 else:
-                    for desc_node in nodes_by_id[node_id]:
+                    for desc_node in nodes_by_id[node_id]['items']:
                         # Short circuit another iteration to find the emit
                         # and assume anything we've done a chooseleaf on
                         # is going to be part of the selected set of osds