From 1fd62579a40edefd005f7a416ba295c4e5fd1edd Mon Sep 17 00:00:00 2001 From: Timothy Asir Jeyasingh Date: Sat, 7 Mar 2015 02:35:14 +0530 Subject: [PATCH] Allow passing KiB values to vgcreate -s option Currently blivet exepects pesize parm of the vgcreate function should be in MiB. Any given value will be converted to MiB format and omits any fractional part. That means, if any KiB values are passed to pesize parm, it becomes 0 and the actual lvm lvcreate faild to create the vg and returns an error. This limits passing any KiB values for pesize to create a vg. This patch fixes the issue by accepting the given value in KiB. Bug url: https://bugzilla.redhat.com/show_bug.cgi?id=1198568 Signed-off-by: Timothy Asir Jeyasingh --- blivet/devicelibs/lvm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blivet/devicelibs/lvm.py b/blivet/devicelibs/lvm.py index a0dc87874..04a532b46 100644 --- a/blivet/devicelibs/lvm.py +++ b/blivet/devicelibs/lvm.py @@ -339,7 +339,7 @@ def pvinfo(device=None): def vgcreate(vg_name, pv_list, pe_size): argv = ["vgcreate"] if pe_size: - argv.extend(["-s", "%sm" % pe_size.convertTo(spec="KiB")]) + argv.extend(["-s", "%sk" % pe_size.convertTo(spec="KiB")]) argv.extend(_getConfigArgs()) argv.append(vg_name) argv.extend(pv_list)