]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: add proper size attribute to partitions 31554/head
authorJan Fajerski <jfajerski@suse.com>
Fri, 8 Nov 2019 16:54:00 +0000 (17:54 +0100)
committerJan Fajerski <jfajerski@suse.com>
Tue, 12 Nov 2019 10:44:50 +0000 (11:44 +0100)
Fixes: https://tracker.ceph.com/issues/42710
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit 26f14d1511087e386f30541af2daf26c664576f3)

src/ceph-volume/ceph_volume/util/disk.py

index 97799466434c5d2cdd7c1a9337655e6182b2e82f..0be90aecc015c322d91219c41612840576f4782c 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)