Add a check for "None" to raise a WicError

Message ID e9f97868891d431f87bed6454e10ef7f@kumkeo.de
State New
Headers show
Series Add a check for "None" to raise a WicError | expand

Commit Message

Ulrich Teichert July 14, 2026, 11:22 a.m. UTC
Add a check for "None" to raise a WicError because get_bitbake_var
may return "None" if the variable is not available, which
would result in an exception inside os.path.isdir and not to the WicError
exception as indented.

Signed-off-by: Ulrich Teichert <ulrich.teichert@kumkeo.de>
---
 scripts/lib/wic/plugins/source/rootfs.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.47.3


Mit freundlichen Grüßen / Best regards


Dipl.-Inform. Ulrich Teichert
Senior Software Engineer



Phone +49 431 375938-0

Patch

diff --git a/scripts/lib/wic/plugins/source/rootfs.py b/scripts/lib/wic/plugins/source/rootfs.py
index e29f3a4c..977ac0d3 100644
--- a/scripts/lib/wic/plugins/source/rootfs.py
+++ b/scripts/lib/wic/plugins/source/rootfs.py
@@ -54,7 +54,7 @@  class RootfsPlugin(SourcePlugin):
             return os.path.realpath(rootfs_dir)

         image_rootfs_dir = get_bitbake_var("IMAGE_ROOTFS", rootfs_dir)
-        if not os.path.isdir(image_rootfs_dir):
+        if image_rootfs_dir == None or not os.path.isdir(image_rootfs_dir):
             raise WicError("No valid artifact IMAGE_ROOTFS from image "
                            "named %s has been found at %s, exiting." %
                            (rootfs_dir, image_rootfs_dir))