cli: try command - handle insufficient user privilege error gracefully - #611
Merged
Merged
Conversation
benhoyt
requested changes
Sep 1, 2026
benhoyt
left a comment
Collaborator
There was a problem hiding this comment.
The overall approach looks reasonable, but a couple of minor comments for consideration.
Also, I'd retitle the PR: the fix here is to handle all errors during revert, not just insufficient user privilege. You should of course mention the specific case in the PR description, though.
JegadishD
force-pushed
the
jegadish/try_cmd_fix
branch
from
September 2, 2026 06:51
471d38b to
ce01396
Compare
For example, when `netplan try` is run without sufficient privileges, it throws an exception. The subsequent revert operation also fails, and this unhandled exception triggers apport crash reports.
JegadishD
force-pushed
the
jegadish/try_cmd_fix
branch
from
September 2, 2026 06:57
ce01396 to
c7f1823
Compare
Collaborator
Author
|
@benhoyt Thanks for the review. I have updated the PR based on the review comments. Please review. |
benhoyt
approved these changes
Sep 3, 2026
Collaborator
|
Thanks, looks good to me. I'm assuming you've done some manual testing locally as well. |
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.
Insufficient privileges is leading to exception and the following revert as well fails with exception which is not handled and triggers apport crash reports. The fix is to catch on revert and exit cleanly with error messages.