]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: check if BBLAYERS is valid before use
authorJoão Henrique Ferreira de Freitas <joaohf@gmail.com>
Wed, 4 Jun 2014 01:28:03 +0000 (22:28 -0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 6 Jun 2014 09:29:22 +0000 (10:29 +0100)
If wic is running as raw mode, it's better to check if BBLAYERS
is valid before inspect it.

No functional changes.

Signed-off-by: João Henrique Ferreira de Freitas <joaohf@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/image/engine.py
scripts/lib/mic/plugin.py

index 3bda1bf2057e0126536fe9fe7cb05813ded0e5d6..12562363049039cf7c897a6ddf11cd11d5dbc69d 100644 (file)
@@ -96,9 +96,10 @@ def build_canned_image_list(dl):
     layers_path = get_bitbake_var("BBLAYERS")
     canned_wks_layer_dirs = []
 
-    for layer_path in layers_path.split():
-        path = os.path.join(layer_path, SCRIPTS_CANNED_IMAGE_DIR)
-        canned_wks_layer_dirs.append(path)
+    if layers_path is not None:
+        for layer_path in layers_path.split():
+            path = os.path.join(layer_path, SCRIPTS_CANNED_IMAGE_DIR)
+            canned_wks_layer_dirs.append(path)
 
     path = os.path.join(dl, CANNED_IMAGE_DIR)
     canned_wks_layer_dirs.append(path)
index dec0e5bf8498df933ad3171cd48970ab9a234abd..585fd6d5630fcef0ecfac005b8694ae5cdc01c84 100644 (file)
@@ -53,9 +53,10 @@ class PluginMgr(object):
             self.layers_path = get_bitbake_var("BBLAYERS")
         layer_dirs = []
 
-        for layer_path in self.layers_path.split():
-            path = os.path.join(layer_path, SCRIPTS_PLUGIN_DIR, ptype)
-            layer_dirs.append(path)
+        if self.layers_path is not None:
+            for layer_path in self.layers_path.split():
+                path = os.path.join(layer_path, SCRIPTS_PLUGIN_DIR, ptype)
+                layer_dirs.append(path)
 
         path = os.path.join(dl, ptype)
         layer_dirs.append(path)