From: Babu Shanmugam Date: Fri, 11 Apr 2014 08:42:25 +0000 (+0000) Subject: Bug fix in the way crush_type is extracted from osd crush dump X-Git-Tag: v0.80-rc1~8^2^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1987832569b67ac2519fc2ee8a5bfab4b9a824da;p=ceph.git Bug fix in the way crush_type is extracted from osd crush dump Signed-off-by: Babu Shanmugam --- diff --git a/client/ceph-brag b/client/ceph-brag index e07ad01b663..6daff795749 100755 --- a/client/ceph-brag +++ b/client/ceph-brag @@ -105,7 +105,8 @@ def get_crush_types(): for bucket in crush_dump['buckets']: buckets[bucket['id']] = bucket['type_id'] for item in bucket['items']: - items_list.append(item['id']) + if item['id'] < 0: + items_list.append(item['id']) crush_map = [] counter = Counter(items_list) @@ -115,13 +116,14 @@ def get_crush_types(): append(crush_types[buckets[id]], count) del buckets[id] - else: - append(crush_types[id], count) #the root item for id,type_id in buckets.items(): append(crush_types[type_id], 1) + if 'devices' in crush_dump: + append('devices', len(crush_dump['devices'])) + return crush_map def get_pool_metadata():