Patchwork [2/2] wic: Initialize return values in find_artifacts()

login
register
mail settings
Submitter tom.zanussi@linux.intel.com
Date Oct. 18, 2013, 4:45 a.m.
Message ID <e26ce5b635c47a689838223431871afef22b3a0d.1382071241.git.tom.zanussi@linux.intel.com>
Download mbox | patch
Permalink /patch/60187/
State Accepted
Commit 67378fbcbe8a418c81ef42589fb6fba704c36bdf
Headers show

Comments

tom.zanussi@linux.intel.com - Oct. 18, 2013, 4:45 a.m.
If one of these isn't found, it won't be initialized and will throw an
UnboundLocalError.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
 scripts/lib/image/engine.py | 2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/scripts/lib/image/engine.py b/scripts/lib/image/engine.py
index be29222..b3a9c74 100644
--- a/scripts/lib/image/engine.py
+++ b/scripts/lib/image/engine.py
@@ -82,6 +82,8 @@  def find_artifacts(image_name):
         print "Couldn't get '%s' output, exiting." % bitbake_env_cmd
         sys.exit(1)
 
+    rootfs_dir = kernel_dir = hdddir = staging_data_dir = native_sysroot = ""
+
     for line in bitbake_env_lines.split('\n'):
         if (get_line_val(line, "IMAGE_ROOTFS")):
             rootfs_dir = get_line_val(line, "IMAGE_ROOTFS")