]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
parsemail: Fix default value of verbosity argument
authorJeremy Kerr <jk@ozlabs.org>
Sun, 27 Mar 2016 04:53:04 +0000 (12:53 +0800)
committerStephen Finucane <stephen.finucane@intel.com>
Tue, 29 Mar 2016 08:57:14 +0000 (09:57 +0100)
With the current parsemail.py, the default value for the verbosity
argument does not exist in the VERBOSITY_LEVELS dict, so we get:

  Traceback (most recent call last):
    File "./patchwork/bin/parsemail.py", line 569, in <module>
      sys.exit(main(sys.argv))
    File "./patchwork/bin/parsemail.py", line 555, in main
      logging.basicConfig(level=VERBOSITY_LEVELS[args['verbosity']])
  KeyError: 20

This change uses an actual key instead.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
patchwork/bin/parsemail.py

index b32ef0b2c447e720f0000b21ac97a3cae46a197a..7a9e00916fe0bcb34c1d6dcdb6150c7567d0aefc 100755 (executable)
@@ -548,7 +548,7 @@ def main(args):
     group.add_argument('--list-id', help='mailing list ID. If not supplied '
                        'this will be extracted from the mail headers.')
     group.add_argument('--verbosity', choices=list_logging_levels(),
-                       help='debug level', default=logging.INFO)
+                       help='debug level', default='info')
 
     args = vars(parser.parse_args())