diff mbox

[2/4] parsemail: Fix default value of verbosity argument

Message ID 1459054386-31394-3-git-send-email-jk@ozlabs.org
State Accepted
Headers show

Commit Message

Jeremy Kerr March 27, 2016, 4:53 a.m. UTC
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>
---
 patchwork/bin/parsemail.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stephen Finucane March 29, 2016, 8:45 a.m. UTC | #1
On 27 Mar 12:53, Jeremy Kerr wrote:
> 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>

I really didn't do enough due diligence with that patch. Hopefully this
is the last related bugfix necessary.

Merged and backported to 'stable/1.1'.

Stephen
Stephen Finucane March 29, 2016, 8:51 a.m. UTC | #2
On 27 Mar 12:53, Jeremy Kerr wrote:
> 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>
diff mbox

Patch

diff --git a/patchwork/bin/parsemail.py b/patchwork/bin/parsemail.py
index 9640ff3..f369fe4 100755
--- a/patchwork/bin/parsemail.py
+++ b/patchwork/bin/parsemail.py
@@ -542,7 +542,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())