From ae4094c1db7c69dd2b44438d3dbb3e4b083dca2e Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sun, 28 Jul 2024 21:09:43 +0200 Subject: [PATCH] Fix "pmbootstrap build_init" (MR 2386) Do not fail with: ERROR: 'Namespace' object has no attribute 'image' Adjust the similar check for args.rootfs to be in the same style while at it. --- pmb/helpers/frontend.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pmb/helpers/frontend.py b/pmb/helpers/frontend.py index 65f32e13..aa686b69 100644 --- a/pmb/helpers/frontend.py +++ b/pmb/helpers/frontend.py @@ -65,10 +65,10 @@ def _parse_flavor(device: str, autoinstall=True): def _parse_suffix(args: PmbArgs) -> Chroot: deviceinfo = pmb.parse.deviceinfo() - if args.image: + if getattr(args, "image", None): rootfs = Chroot.native() / f"home/pmos/rootfs/{deviceinfo.codename}.img" return Chroot(ChrootType.IMAGE, str(rootfs)) - if "rootfs" in args and args.rootfs: + if getattr(args, "rootfs", None): return Chroot(ChrootType.ROOTFS, get_context().config.device) elif args.buildroot: if args.buildroot == "device":