]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: add proper size attribute to partitions 32529/head
authorJan Fajerski <jfajerski@suse.com>
Fri, 8 Nov 2019 16:54:00 +0000 (17:54 +0100)
committerJan Fajerski <jfajerski@suse.com>
Tue, 7 Jan 2020 15:46:29 +0000 (16:46 +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 fbf30050c8c988c45ec39e1b1cd5c60af586949e..8ac215b8821ba850256fb214ee6abb4c1ceca393 100644 (file)
@@ -706,7 +706,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)