[oe-commits] Paul Eggleton : lib/oe/image.py: add error checking for missing IMAGE_CMD

git at git.openembedded.org git at git.openembedded.org
Tue Feb 3 14:54:13 UTC 2015


Module: openembedded-core.git
Branch: master
Commit: f38c35b925d6eab0d5a41b8592b0eb8b0a3b7b72
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=f38c35b925d6eab0d5a41b8592b0eb8b0a3b7b72

Author: Paul Eggleton <paul.eggleton at linux.intel.com>
Date:   Tue Jan 27 10:02:38 2015 +0000

lib/oe/image.py: add error checking for missing IMAGE_CMD

An invalid value in IMAGE_FSTYPES was triggering a traceback. Add a
check and a reasonable error message instead.

Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>

---

 meta/lib/oe/image.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/image.py b/meta/lib/oe/image.py
index f9c8f84..0ce303d 100644
--- a/meta/lib/oe/image.py
+++ b/meta/lib/oe/image.py
@@ -296,7 +296,11 @@ class Image(ImageDepGraph):
                 bb.data.update_data(localdata)
                 localdata.setVar('type', type)
 
-                cmds.append("\t" + localdata.getVar("IMAGE_CMD", True))
+                image_cmd = localdata.getVar("IMAGE_CMD", True)
+                if image_cmd:
+                    cmds.append("\t" + image_cmd)
+                else:
+                    bb.fatal("No IMAGE_CMD defined for IMAGE_FSTYPES entry '%s' - possibly invalid type name or missing support class" % type)
                 cmds.append(localdata.expand("\tcd ${DEPLOY_DIR_IMAGE}"))
 
                 if type in cimages:



More information about the Openembedded-commits mailing list