[PATCH] Fix unspecified action bug v2

Jan Tluka jtluka at redhat.com
Fri May 24 08:52:04 UTC 2013


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>
---
 lnst-ctl | 6 +++---
 1 file 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()
-- 
1.7.11.7



More information about the LNST-developers mailing list