rel_upgrade_root: Import syslog - #1099
Open
Amadeus-22 wants to merge 1 commit into
Open
Amadeus-22 wants to merge 1 commit into
Amadeus-22 wants to merge 1 commit into
Conversation
on_removals_finished logs with syslog.syslog() when update-grub fails, but the module never imports syslog. If update-grub is missing or raises, the handler itself fails with NameError, so Gtk.main_quit() and sys.exit(0) are not reached and the upgrade process never exits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
on_removals_finished(the last step of the release upgrade, which runsupdate-grub) logs a failure withsyslog.syslog(), butrel_upgrade_root.pynever importssyslog.So if
update-grubis missing or raises (subprocess.runraisesFileNotFoundErrorwhen the command does not exist), theexceptblock itself fails withNameError: name 'syslog' is not defined. The exception is raised inside the aptkit callback, soGtk.main_quit()andsys.exit(0)are never reached and the root upgrade process stays alive in the GTK main loop.The fix is the missing import. No other module in the repository imports
syslogeither, and this is the only use.To check it without running a real release upgrade, I executed the real
Upgrader.on_removals_finishedin a harness that stubs GTK and makessubprocess.runraiseFileNotFoundError:NameError: name 'syslog' is not defined, andGtk.main_quit()is never calledGtk.main_quit()is called and the process exits with code 0I did not run a real release upgrade.
🤖 Generated with Claude Code