[for-denzil,3/3] bitbake: command: Fix getCmdLineAction bugs

Submitted by Matthew McClintock on Jan. 11, 2013, 7:03 a.m.


Message ID 1357887783-25188-3-git-send-email-msm@freescale.com
State Accepted
Commit dc637ae860f57161c97b04d3e91612d3e1600f37
Headers show

Commit Message

Matthew McClintock Jan. 11, 2013, 7:03 a.m.
From: Richard Purdie <richard.purdie@linuxfoundation.org>

Executing "bitbake" doesn't get a sane message since the None return value
wasn't being handled correctly. Also fix msg -> cmd_action['msg'] as
otherwise an invalid variable is accessed which then crashes the server
due to the previous bug.

(Bitbake rev: c6211291ae07410832031a5274690437cc2b09a6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
 bitbake/lib/bb/command.py |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
index c08e2ce..a143aed 100644
--- a/bitbake/lib/bb/command.py
+++ b/bitbake/lib/bb/command.py
@@ -148,8 +148,10 @@  class CommandsSync:
         Get any command parsed from the commandline
         cmd_action = command.cooker.commandlineAction
-        if cmd_action['msg']:
-            raise CommandError(msg)
+        if cmd_action is None:
+            return None
+        elif 'msg' in cmd_action and cmd_action['msg']:
+            raise CommandError(cmd_action['msg'])
             return cmd_action['action']