]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: add proper size attribute to partitions 31492/head
authorJan Fajerski <jfajerski@suse.com>
Fri, 8 Nov 2019 16:54:00 +0000 (17:54 +0100)
committerJan Fajerski <jfajerski@suse.com>
Fri, 8 Nov 2019 16:55:33 +0000 (17:55 +0100)
Fixes: https://tracker.ceph.com/issues/42710
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
src/ceph-volume/ceph_volume/util/disk.py

index ab26359d929843e731974ac963bfe57b56f1c929..f81d23621e51888e28594bae6d23782fd076f3f4 100644 (file)
@@ -726,7 +726,8 @@ def get_partitions_facts(sys_block_path):
                 if not part['sectorsize']:
                     part['sectorsize'] = get_file_contents(
                         part_sys_block_path + "/queue/hw_sector_size", 512)
-                part['size'] = human_readable_size(float(part['sectors']) * 512)
+                part['size'] = float(part['sectors']) * 512
+                part['human_readable_size'] = human_readable_size(float(part['sectors']) * 512)
                 part['holders'] = []
                 for holder in os.listdir(part_sys_block_path + '/holders'):
                     part['holders'].append(holder)