]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Bug fix in the way crush_type is extracted from osd crush dump
authorBabu Shanmugam <anbu@enovance.com>
Fri, 11 Apr 2014 08:42:25 +0000 (08:42 +0000)
committerBabu Shanmugam <anbu@enovance.com>
Fri, 11 Apr 2014 08:42:25 +0000 (08:42 +0000)
Signed-off-by: Babu Shanmugam <anbu@enovance.com>
client/ceph-brag

index e07ad01b6635c0d55961f0812f895a6195dc380b..6daff79574984bf9788e59e2e83a932a5093d78d 100755 (executable)
@@ -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():