fix(dnf): add -y to dnf5 offline reboot and dnf system-upgrade reboot to prevent stdin hang

This commit is contained in:
soda64 committed 2026-10-02 19:16:19 +02:00
1 parent 89cee406df
commit 345773077c
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -230,8 +230,8 @@ def trigger_system_reboot(
cmd_candidates: List[List[str]] = []
if is_release_upgrade and distro_id.lower() == "fedora":
cmd_candidates.append(["dnf5", "offline", "reboot"])
cmd_candidates.append(["dnf", "system-upgrade", "reboot"])
cmd_candidates.append(["dnf5", "-y", "offline", "reboot"])
cmd_candidates.append(["dnf", "-y", "system-upgrade", "reboot"])
cmd_candidates.append(["systemctl", "reboot"])
cmd_candidates.append(["reboot"])
+1 -1
View File
@@ -443,7 +443,7 @@ class TestCLIIntegration(unittest.TestCase):
res = trigger_system_reboot("fedora", is_release_upgrade=True, runner=mock_runner)
self.assertTrue(res)
# Must try dnf5 offline reboot first if available
mock_runner.run.assert_called_once_with(["/usr/bin/dnf5", "offline", "reboot"])
mock_runner.run.assert_called_once_with(["/usr/bin/dnf5", "-y", "offline", "reboot"])
def test_trigger_system_reboot_general_systemctl(self):
from linux_updater.cli import trigger_system_reboot