]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
restful: Fix regression when traversing leaf nodes 26421/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 09:36:01 +0000 (10:36 +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>
src/pybind/mgr/restful/common.py

index 0ab71e3f9d4f910a169435524a8452bad0672456..6eb3e416a800f017a5785aabaaffa715a1601b82 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