[lnst] Fix unspecified action bug v2

Jiří Pírko jirka at fedoraproject.org
Fri May 24 09:17:21 UTC 2013


commit 2a7961e9ce646b46c0ea120a153fbf29120284cc
Author: Jan Tluka <jtluka at redhat.com>
Date:   Fri May 24 10:52:04 2013 +0200

    Fix unspecified action bug v2
    
    If a user omitted action in the lnst-ctl arguments the script would continue
    in its execution with no obvious error. I fixed the code so the user gets
    information about incorrect arguments and script stops if no action is
    specified.
    
    Signed-off-by: Jan Tluka <jtluka at redhat.com>
    Signed-off-by: Jiri Pirko <jiri at resnulli.us>

 lnst-ctl |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/lnst-ctl b/lnst-ctl
index dcb4cd2..1ed3515 100755
--- a/lnst-ctl
+++ b/lnst-ctl
@@ -143,12 +143,12 @@ def main():
                          log_dir=config.get_option('environment', 'log_dir'),
                          log_subdir=date)
 
-    if not args:
+    action = args.pop()
+
+    if not action in {'run', 'dump', 'config_only', 'match_setup'}:
         logging.error("No action command passed")
         usage();
 
-    action = args.pop()
-
     summary = []
 
     res_serializer = NetTestResultSerializer()


More information about the LNST-developers mailing list