forked from rpms/leapp-repository
41 lines
1.4 KiB
Diff
41 lines
1.4 KiB
Diff
From 9b06998b2077d0007da818059d5c6e244ac55948 Mon Sep 17 00:00:00 2001
|
|
From: Peter Mocary <pmocary@redhat.com>
|
|
Date: Mon, 10 Nov 2025 19:31:25 +0100
|
|
Subject: [PATCH 49/55] fix parsing of dnf config dump
|
|
|
|
This patch fixes handling of empty lines during parsing of output from
|
|
`dnf config-manager --dump` command.
|
|
|
|
Jira: RHEL-120328
|
|
---
|
|
repos/system_upgrade/common/libraries/dnfconfig.py | 4 +++-
|
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/repos/system_upgrade/common/libraries/dnfconfig.py b/repos/system_upgrade/common/libraries/dnfconfig.py
|
|
index 4b5afeb5..9f1902b6 100644
|
|
--- a/repos/system_upgrade/common/libraries/dnfconfig.py
|
|
+++ b/repos/system_upgrade/common/libraries/dnfconfig.py
|
|
@@ -43,8 +43,11 @@ def _get_main_dump(context, disable_plugins):
|
|
|
|
output_data = {}
|
|
for line in data[main_start:]:
|
|
+ if not line.strip():
|
|
+ continue
|
|
try:
|
|
key, val = _strip_split(line, '=', 1)
|
|
+ output_data[key] = val
|
|
except ValueError:
|
|
# This is not expected to happen, but call it a seatbelt in case
|
|
# the dnf dump implementation will change and we will miss it
|
|
@@ -54,7 +57,6 @@ def _get_main_dump(context, disable_plugins):
|
|
api.current_logger().warning(
|
|
'Cannot parse the dnf dump correctly, line: {}'.format(line))
|
|
pass
|
|
- output_data[key] = val
|
|
|
|
return output_data
|
|
|
|
--
|
|
2.51.1
|
|
|