aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSai Sindhur Malleni <smalleni@redhat.com>2016-08-09 10:26:45 -0400
committerSai Sindhur Malleni <smalleni@redhat.com>2016-08-10 12:53:22 -0400
commitd826cafd69c9679a29a88a97699756cd408e4ac7 (patch)
tree185b1a0ddc607a3a45b07354aab5950ea7d0ce1c
parent42d97ed0627db286c1b1de445ba45a4dc3d9079e (diff)
Fix Argument Parsing
Not making the option -l and -f causes a traceback when checking if -l is a valid directory and -f is a valid file as concatenation is attemtped between string and None type. Signed-off-by: Sai Sindhur Malleni <smalleni@redhat.com> Change-Id: If0ae87cde0e43122b3318f9c3749c05639ac3f36
-rw-r--r--func/cli.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/func/cli.py b/func/cli.py
index 5e8f02cf..4613b507 100644
--- a/func/cli.py
+++ b/func/cli.py
@@ -54,13 +54,15 @@ class cli:
@staticmethod
def _parse_args(args):
parser = argparse.ArgumentParser()
- parser.add_argument('-l ', '--lab', help='Name of Lab on which being tested, These can'
+ parser.add_argument('-l ', '--lab', required=True, help='Name of Lab '
+ 'on which being tested, These can'
'be found in the test_cases/ directory. Please '
'ensure that you have edited the respective files '
'before using them. For testing other than through Jenkins'
' The user should list default after -l . all the fields in'
' the files are necessary and should be filled')
- parser.add_argument('-f', '--file', help='File in test_list with the list of tests. there are three files'
+ parser.add_argument('-f', '--file', required=True, help='File in '
+ 'test_list with the list of tests. there are three files'
'\n compute '
'\n storage '
'\n network '