From 551a1049fa5e919dbe8cd6e58f3ea4341f2a2d06 Mon Sep 17 00:00:00 2001 From: pkratoch Date: Tue, 7 Jan 2025 14:01:20 +0100 Subject: [PATCH] Revert "Adjust extract_section_content_from_text for dnf5" This reverts commit b4dba41686986126bab97cce250b5f9d7d2ec531. --- dnf-behave-tests/dnf/steps/cmd.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/dnf-behave-tests/dnf/steps/cmd.py b/dnf-behave-tests/dnf/steps/cmd.py index 46dd80f25..dcb0bcae6 100644 --- a/dnf-behave-tests/dnf/steps/cmd.py +++ b/dnf-behave-tests/dnf/steps/cmd.py @@ -33,14 +33,11 @@ def extract_section_content_from_text(section_header, text): parsed = '' copy = False for line in text.split('\n'): - strippedline = line.strip() - # in dnf5 there can be spaces after some section headers - # (e.g. 'Installing:', 'Upgrading:' etc.) - if (not copy) and section_header == strippedline: + if (not copy) and section_header == line: copy = True continue if copy: # copy lines until hitting empty line or another known header - if strippedline and strippedline not in SECTION_HEADERS: + if line.strip() and line not in SECTION_HEADERS: parsed += "%s\n" % line else: return parsed