]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
command: Fix getCmdLineAction bugs
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 14 Dec 2012 12:27:33 +0000 (12:27 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 14 Dec 2012 12:35:25 +0000 (12:35 +0000)
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/command.py

index 39a2e18a0236f75d37b4bbe0ba7ab83de513de51..c842497e63bf1864c89f5fa6f1fa335f4ceb7272 100644 (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']