forked from Mirror/pmbootstrap
pmb.install.blockdevice: Avoid reusing size_mb variable in create_and_mount_image() (MR 2464)
Reusing this variable might lead to confusing bugs later if this code is changed in the future, and also leads to mypy being confused about the type of size_mb as it then gets assigned both str and int values.
This commit is contained in:
parent
f507aed9aa
commit
1aa0b05014
1 changed files with 3 additions and 3 deletions
|
@ -105,9 +105,9 @@ def create_and_mount_image(args: PmbArgs, size_boot, size_root, size_reserve, sp
|
|||
images = {img_path_full: size_mb_full}
|
||||
if split:
|
||||
images = {img_path_boot: size_mb_boot, img_path_root: size_mb_root}
|
||||
for img_path, size_mb in images.items():
|
||||
logging.info(f"(native) create {img_path.name} " f"({size_mb})")
|
||||
pmb.chroot.root(["truncate", "-s", size_mb, img_path])
|
||||
for img_path, image_size_mb in images.items():
|
||||
logging.info(f"(native) create {img_path.name} " f"({image_size_mb})")
|
||||
pmb.chroot.root(["truncate", "-s", image_size_mb, img_path])
|
||||
|
||||
# Mount to /dev/install
|
||||
mount_image_paths = {img_path_full: "/dev/install"}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue