commit 20ffd6301e20e8231c38208a994151221eb11701 Author: Radek Pazdera rpazdera@redhat.com Date: Fri Aug 30 14:49:38 2013 +0200
lnst-ctl: Output usage when no action was specified
This commit fixes Issue #6.
Signed-off-by: Radek Pazdera rpazdera@redhat.com Signed-off-by: Jiri Pirko jiri@resnulli.us
lnst-ctl | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) --- diff --git a/lnst-ctl b/lnst-ctl index 39bb5cf..55e2dd1 100755 --- a/lnst-ctl +++ b/lnst-ctl @@ -58,9 +58,6 @@ def process_recipe(action, file_path, cleanup, res_serializer, return nettestctl.config_only_recipe() elif action == "match_setup": return nettestctl.match_setup() - else: - logging.error("Unknown action "%s"" % action) - usage();
def get_recipe_result(args, file_path, cleanup, res_serializer, packet_capture, log_ctl, pool_checks): @@ -144,11 +141,14 @@ def main(): log_dir=lnst_config.get_option('environment', 'log_dir'), log_subdir=date, colours=coloured_output)
- action = args.pop() + if len(args) <= 0: + logging.error("No action specified") + usage()
+ action = args.pop() if not action in ['run', 'dump', 'config_only', 'match_setup']: - logging.error("No action command passed") - usage(); + logging.error("Action '%s' not recognised" % action) + usage()
summary = []
lnst-developers@lists.fedorahosted.org