From ebd9f7b1da8ed556e98aab4d5f4e81707ac44b27 Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Tue, 16 Jun 2015 14:19:49 +0300 Subject: wic: Return error code when wic fails to invoke command Return 1 if command doesn't exist or wic is called without any commmand. Return result of invoke_command as wic return code. Added tests for unsupported command and no command. Fixed typo in test case test02_createhelp spotted by this fix. [YOCTO #7856] Signed-off-by: Ed Bartosh --- scripts/lib/image/help.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts/lib/image') diff --git a/scripts/lib/image/help.py b/scripts/lib/image/help.py index ce42627cdb..93211498d5 100644 --- a/scripts/lib/image/help.py +++ b/scripts/lib/image/help.py @@ -81,11 +81,13 @@ def invoke_subcommand(args, parser, main_command_usage, subcommands): if not args: logging.error("No subcommand specified, exiting") parser.print_help() + return 1 elif args[0] == "help": wic_help(args, main_command_usage, subcommands) elif args[0] not in subcommands: logging.error("Unsupported subcommand %s, exiting\n" % (args[0])) parser.print_help() + return 1 else: usage = subcommands.get(args[0], subcommand_error)[1] subcommands.get(args[0], subcommand_error)[0](args[1:], usage) -- cgit 1.2.3-korg