diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-08-30 12:53:30 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-02 18:09:49 +0100 |
commit | 3658f6d4770b9015561b33c1e24078b1713372e4 (patch) | |
tree | a663999a4ff3fb1be6202ec7efae506ae56dbb6f /bitbake/lib/bb | |
parent | 412a26e154fb70473f2d96283f383aebce8f8e5e (diff) | |
download | poky-3658f6d4770b9015561b33c1e24078b1713372e4.tar.gz |
bitbake: cookerdata/ast: Fail gracefully if event handler function is not found
[YOCTO #10186]
(Bitbake rev: 107c47c4e6de6a596cf1aeca5c18dbc1c5b44dc4)
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/cookerdata.py | 3 | ||||
-rw-r--r-- | bitbake/lib/bb/parse/ast.py | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py index fa1de7a22f..bf9bfbf931 100644 --- a/bitbake/lib/bb/cookerdata.py +++ b/bitbake/lib/bb/cookerdata.py | |||
@@ -357,6 +357,9 @@ class CookerDataBuilder(object): | |||
357 | # We register any handlers we've found so far here... | 357 | # We register any handlers we've found so far here... |
358 | for var in data.getVar('__BBHANDLERS', False) or []: | 358 | for var in data.getVar('__BBHANDLERS', False) or []: |
359 | handlerfn = data.getVarFlag(var, "filename", False) | 359 | handlerfn = data.getVarFlag(var, "filename", False) |
360 | if not handlerfn: | ||
361 | parselog.critical("Undefined event handler function '%s'" % var) | ||
362 | sys.exit(1) | ||
360 | handlerln = int(data.getVarFlag(var, "lineno", False)) | 363 | handlerln = int(data.getVarFlag(var, "lineno", False)) |
361 | bb.event.register(var, data.getVar(var, False), (data.getVarFlag(var, "eventmask", True) or "").split(), handlerfn, handlerln) | 364 | bb.event.register(var, data.getVar(var, False), (data.getVarFlag(var, "eventmask", True) or "").split(), handlerfn, handlerln) |
362 | 365 | ||
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py index d7185b1664..fa83b18981 100644 --- a/bitbake/lib/bb/parse/ast.py +++ b/bitbake/lib/bb/parse/ast.py | |||
@@ -344,6 +344,8 @@ def finalize(fn, d, variant = None): | |||
344 | for var in d.getVar('__BBHANDLERS', False) or []: | 344 | for var in d.getVar('__BBHANDLERS', False) or []: |
345 | # try to add the handler | 345 | # try to add the handler |
346 | handlerfn = d.getVarFlag(var, "filename", False) | 346 | handlerfn = d.getVarFlag(var, "filename", False) |
347 | if not handlerfn: | ||
348 | bb.fatal("Undefined event handler function '%s'" % var) | ||
347 | handlerln = int(d.getVarFlag(var, "lineno", False)) | 349 | handlerln = int(d.getVarFlag(var, "lineno", False)) |
348 | bb.event.register(var, d.getVar(var, False), (d.getVarFlag(var, "eventmask", True) or "").split(), handlerfn, handlerln) | 350 | bb.event.register(var, d.getVar(var, False), (d.getVarFlag(var, "eventmask", True) or "").split(), handlerfn, handlerln) |
349 | 351 | ||