dnf/0037-automatic-Fix-incorrect-Error-class-instantiation.patch
Marek Blaha 8f8fd5155f automatic: Backport patches
- upstream commit 130d6b91694a93a142be8c3767bfc711245dea1c to resolve
  error in dnf.exceptions.Error class instantiating
- upstream commit 193e3f4e212e1fafcd24faad7f026ea05d2f97b9 to match
  dnf-automatic need_reboot behavior to that of `dnf needs-restarting`

Resolves: RHEL-45505
Resolves: RHEL-62830
2024-12-12 11:08:28 +01:00

28 lines
1.2 KiB
Diff

From c57c26e0cf8a3bba061f5ddf619c40f36a94aab9 Mon Sep 17 00:00:00 2001
From: Marek Blaha <mblaha@redhat.com>
Date: Thu, 12 Dec 2024 08:09:48 +0100
Subject: [PATCH] automatic: Fix incorrect Error class instantiation
dnf.exceptions.Error class constructor accepts only one argument - error
message.
---
dnf/automatic/main.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dnf/automatic/main.py b/dnf/automatic/main.py
index 5ca4ad39..51057dfb 100644
--- a/dnf/automatic/main.py
+++ b/dnf/automatic/main.py
@@ -378,7 +378,7 @@ def main(args):
(conf.commands.reboot == 'when-needed' and base.reboot_needed())):
exit_code = os.waitstatus_to_exitcode(os.system(conf.commands.reboot_command))
if exit_code != 0:
- raise dnf.exceptions.Error('reboot command returned nonzero exit code: %d', exit_code)
+ raise dnf.exceptions.Error('reboot command returned nonzero exit code: %d' % exit_code)
except Exception as exc:
logger.error(_('Error: %s'), ucd(exc))
if conf is not None and conf.emitters.send_error_messages and emitters is not None:
--
2.47.1