Loglevel arguments not parsed but accessed #124

Closed
opened 2021-11-20 13:24:18 +00:00 by ungleich-gitea · 0 comments

Created by: robinkrahl

7ccc959ebd effectively disabled the loglevel argument parser, yet cdist.argparse.handle_loglevel still tries to access args.quiet (cdist/argparse.py, L437). This leads to a AttributeError, making cdist unusable.

$ cdist
Traceback (most recent call last):
  File ".../bin/cdist", line 79, in <module>
    commandline()
  File ".../bin/cdist", line 38, in commandline
    parser, cfg = cdist.argparse.parse_and_configure(sys.argv[1:])
  File ".../lib/python3.6/site-packages/cdist/argparse.py", line 453, in parse_and_configure
    handle_loglevel(args)
  File ".../lib/python3.6/site-packages/cdist/argparse.py", line 437, in handle_loglevel
    if args.quiet:
AttributeError: 'Namespace' object has no attribute 'quiet'
$ cdist --version
cdist 4.8.1
*Created by: robinkrahl* 7ccc959ebdf58d186d260bfd36966ab942117865 effectively disabled the loglevel argument parser, yet `cdist.argparse.handle_loglevel` still tries to access `args.quiet` ([`cdist/argparse.py`, L437](https://github.com/ungleich/cdist/blob/master/cdist/argparse.py#L437)). This leads to a `AttributeError`, making cdist unusable. ``` $ cdist Traceback (most recent call last): File ".../bin/cdist", line 79, in <module> commandline() File ".../bin/cdist", line 38, in commandline parser, cfg = cdist.argparse.parse_and_configure(sys.argv[1:]) File ".../lib/python3.6/site-packages/cdist/argparse.py", line 453, in parse_and_configure handle_loglevel(args) File ".../lib/python3.6/site-packages/cdist/argparse.py", line 437, in handle_loglevel if args.quiet: AttributeError: 'Namespace' object has no attribute 'quiet' $ cdist --version cdist 4.8.1 ```
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ungleich-public/cdist#124
No description provided.