The node dict that is passed to the _gather_leaf_ids function from the
_gather_osds function does not have 'items' in it. We also can't use
buckets at this point since those only exist for leaf nodes, not all
nodes.
We need to query the nodes_by_id dict to get 'items' for a node inside
the _gather_leaf_ids function instead.
Signed-off-by: Boris Ranto <branto@redhat.com>
return set([node['id']])
result = set()
- for item in node['items']:
- if item['id'] >= 0:
- result.add(item['id'])
- else:
- result |= _gather_leaf_ids(nodes_by_id[item['id']])
+ for item in nodes_by_id[node['id']]['items']:
+ result |= _gather_leaf_ids(item)
return result