In _gather_osds() processing `choose_firstn`, it tries to
traverse the keys of a `dict` (nodes_by_id[node_id]) but not
real nodes, thus mistakenly passing `str` to _gather_osds()
to do recursion.
Fixes: http://tracker.ceph.com/issues/48488
Signed-off-by: Jerry Pu <yician1000@gmail.com>
if node_id >= 0:
osds.add(node_id)
else:
- for desc_node in nodes_by_id[node_id]:
- osds |= _gather_osds(desc_node, steps[1:])
+ osds |= _gather_osds(nodes_by_id[node_id], steps[1:])
elif step['op'] == 'chooseleaf_firstn':
# Choose all descendents of the current node of type 'type',
# and select all leaves beneath those