bitbake: command: Fix getCmdLineAction bugs

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>
This commit is contained in:
Richard Purdie 2013-01-27 15:41:22 -08:00
parent 2a69358610
commit 6caa7d1d6c

View File

@ -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'])
else:
return cmd_action['action']