Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Debug: Fix abort in debug mode on unknown entries' #49

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ max-attributes=11

# Maximum number of branch for function / method body.
# defaults to: max-branches=12
max-branches=64
max-branches=18

# Maximum number of locals for function / method body.
# defaults to: max-locals=15
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def input(prompt):
"xenserver-config",
"xenserver-databases",
"mock",
"unknown",
]
sys.argv.append("--entries=" + ",".join(entries))
bugtool.BUG_DIR = tmp
Expand Down
7 changes: 6 additions & 1 deletion xen-bugtool
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,8 @@ Capture information to help diagnose bugs.
-d, --debug enable debug output
--help this help'''

def main(argv = None): # pylint: disable=too-many-statements

def main(argv=None): # pylint: disable=too-many-statements,too-many-branches
global ANSWER_YES_TO_ALL, SILENT_MODE
global entries, dbg
global unlimited_data, unlimited_time
Expand Down Expand Up @@ -747,6 +748,10 @@ def main(argv = None): # pylint: disable=too-many-statements
entries.append(item[0])
if item[0] in caps and len(item) > 1:
update_cap(item[0], VERBOSITY, min(9, max(1, int(item[1]))))
for key in entries:
if key not in caps:
logging.warning("--entries=%s is not known!", key)
entries.remove(key)

# If the user runs the script with "-y" or "--yestoall" we don't ask
# all the really annoying questions.
Expand Down
Loading