leapp-repository/0048-Fix-storage-scanner-parsing-error.patch
Petr Stodulka 8bdb7909b8 IPU 9.6-10.0: CTC 2 candidate 1
- Obsolete RHEL9 GPG key signed with SHA1
- Activate LVM VGs with `--sysinit` option to correct the use in the upgrade initramfs
- Fix output of commands executed inside systemd-nspawn containers
- Fix pes events scanner crashing when there are duplicate packages in the received instructions
- Fix pes events scanner not respecting user’s transaction configuration
- Fix remediation instructions for deprecated NM configuration
- Fix storage scanner crashing when command outputs contain colon character
- Minor improvements in preupgrade reports
- Resolves: RHEL-57043, RHEL-31428, RHEL-33373, RHEL-69829, RHEL-71517
2025-01-17 16:33:37 +01:00

50 lines
2.2 KiB
Diff

From d183370047ab5ef139825dfce7a1b4d6f987092f Mon Sep 17 00:00:00 2001
From: tomasfratrik <tomasfratrik8@gmail.com>
Date: Fri, 28 Jun 2024 14:27:41 +0200
Subject: [PATCH 48/53] Fix storage scanner parsing error
Fix storagescanner actor crash when parsing the output of,
e.g., 'pvs -a', which used ':' as a separator and caused errors.
The issue occurred because separator ':' is used to split the outputs of executed commands.
This commit resolves the problem by changing the separator to '|'.
Jira: RHEL-34570
---
.../actors/storagescanner/libraries/storagescanner.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/repos/system_upgrade/common/actors/storagescanner/libraries/storagescanner.py b/repos/system_upgrade/common/actors/storagescanner/libraries/storagescanner.py
index cad6bd32..cae38731 100644
--- a/repos/system_upgrade/common/actors/storagescanner/libraries/storagescanner.py
+++ b/repos/system_upgrade/common/actors/storagescanner/libraries/storagescanner.py
@@ -206,7 +206,7 @@ def _get_lsblk_info():
@aslist
def _get_pvs_info():
""" Collect storage info from pvs command """
- for entry in _get_cmd_output(['pvs', '--noheadings', '--separator', r':'], ':', 6):
+ for entry in _get_cmd_output(['pvs', '--noheadings', '--separator', r'|'], '|', 6):
pv, vg, fmt, attr, psize, pfree = entry
yield PvsEntry(
pv=pv,
@@ -220,7 +220,7 @@ def _get_pvs_info():
@aslist
def _get_vgs_info():
""" Collect storage info from vgs command """
- for entry in _get_cmd_output(['vgs', '--noheadings', '--separator', r':'], ':', 7):
+ for entry in _get_cmd_output(['vgs', '--noheadings', '--separator', r'|'], '|', 7):
vg, pv, lv, sn, attr, vsize, vfree = entry
yield VgsEntry(
vg=vg,
@@ -235,7 +235,7 @@ def _get_vgs_info():
@aslist
def _get_lvdisplay_info():
""" Collect storage info from lvdisplay command """
- for entry in _get_cmd_output(['lvdisplay', '-C', '--noheadings', '--separator', r':'], ':', 12):
+ for entry in _get_cmd_output(['lvdisplay', '-C', '--noheadings', '--separator', r'|'], '|', 12):
lv, vg, attr, lsize, pool, origin, data, meta, move, log, cpy_sync, convert = entry
yield LvdisplayEntry(
lv=lv,
--
2.47.1