livemedia-creator: Fix off by 1024 error

commit 4699c88109 changed how the disk
size is estimated and not all users took into account that the return
value is in MiB.

This would result in qemu based iso installations having a rootfs.img
that was 1024x too large.
This commit is contained in:
Brian C. Lane 2016-03-21 12:14:28 -07:00
parent 66241f7cd7
commit 6798f7c5ec
1 changed files with 3 additions and 2 deletions

View File

@ -989,7 +989,8 @@ def calculate_disk_size(opts, ks):
:param opts: options passed to livemedia-creator
:type opts: argparse options
:param str ks: Path to the kickstart to use for the installation
:returns: Disk size in MiB
:rtype: int
"""
# Disk size for a filesystem image should only be the size of /
# to prevent surprises when using the same kickstart for different installations.
@ -1480,7 +1481,7 @@ def main():
disk_img = opts.disk_image or disk_img
with PartitionMount(disk_img) as img_mount:
if img_mount and img_mount.mount_dir:
make_runtime(opts, img_mount.mount_dir, work_dir, calculate_disk_size(opts, ks))
make_runtime(opts, img_mount.mount_dir, work_dir, calculate_disk_size(opts, ks)/1024.0)
result_dir = make_livecd(opts, img_mount.mount_dir, work_dir)
# --iso-only removes the extra build artifacts, keeping only the boot.iso