fix: handle_exceptions is not a valid parameter#864
Merged
richm merged 1 commit intolinux-system-roles:mainfrom Apr 30, 2026
Merged
fix: handle_exceptions is not a valid parameter#864richm merged 1 commit intolinux-system-roles:mainfrom
richm merged 1 commit intolinux-system-roles:mainfrom
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts the NetworkManager connection forgetting logic to remove an invalid subprocess parameter and add logging for both normal and exceptional paths. Sequence diagram for updated forget_nm_connection subprocess handlingsequenceDiagram
participant NetworkConnections
participant Subprocess
participant Logger
NetworkConnections->>Subprocess: run_command(args)
Subprocess-->>NetworkConnections: rc, stdout, stderr
NetworkConnections->>Logger: log_info(0, forget_nm_connection rc, stdout, stderr)
alt exception_raised
NetworkConnections->>Logger: log_error(0, forget_nm_connection exception traceback)
end
Flow diagram for updated forget_nm_connection control flowflowchart TD
A[forget_nm_connection called] --> B[Call run_command without handle_exceptions]
B --> C{Exception raised?}
C -- No --> D[log_info rc, stdout, stderr]
D --> E[Return]
C -- Yes --> F[log_error with traceback]
F --> E[Return]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
Author
|
[citest] |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The
except Exception: passblock still swallows all errors; now that you log the traceback, consider either narrowing the exception type or re-raising after logging so unexpected failures aren’t silently ignored. - The new info-level log of every
forget_nm_connectioncall may be noisy in normal operation; consider using a debug-level log or gating it behind a verbosity flag if this is primarily for troubleshooting.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `except Exception: pass` block still swallows all errors; now that you log the traceback, consider either narrowing the exception type or re-raising after logging so unexpected failures aren’t silently ignored.
- The new info-level log of every `forget_nm_connection` call may be noisy in normal operation; consider using a debug-level log or gating it behind a verbosity flag if this is primarily for troubleshooting.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #864 +/- ##
==========================================
- Coverage 43.11% 42.68% -0.43%
==========================================
Files 12 13 +1
Lines 3124 3160 +36
==========================================
+ Hits 1347 1349 +2
- Misses 1777 1811 +34 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Rich Megginson <rmeggins@redhat.com>
Contributor
Author
|
[citest] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Rich Megginson rmeggins@redhat.com
Summary by Sourcery
Improve error handling and logging when forgetting a NetworkManager connection.
Bug Fixes:
Enhancements: