Fix Argument Parsing 33/18233/2
authorSai Sindhur Malleni <smalleni@redhat.com>
Tue, 9 Aug 2016 14:26:45 +0000 (10:26 -0400)
committerSai Sindhur Malleni <smalleni@redhat.com>
Wed, 10 Aug 2016 16:53:22 +0000 (12:53 -0400)
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

func/cli.py

index 5e8f02c..4613b50 100644 (file)
@@ -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 '