From d826cafd69c9679a29a88a97699756cd408e4ac7 Mon Sep 17 00:00:00 2001 From: Sai Sindhur Malleni Date: Tue, 9 Aug 2016 10:26:45 -0400 Subject: 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 Change-Id: If0ae87cde0e43122b3318f9c3749c05639ac3f36 --- func/cli.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'func') 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 ' -- cgit 1.2.3-korg