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(a)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
Show replies by date