Fix UnboundLocalError in MD populator (#2263668)

This commit is contained in:
Vojtech Trefny 2024-02-12 18:35:27 +01:00
parent 5bd5783dc1
commit 0a538e637b
2 changed files with 31 additions and 1 deletions

View File

@ -0,0 +1,26 @@
From c141179b18984c5a96cd605c29df9716c714afe8 Mon Sep 17 00:00:00 2001
From: Vojtech Trefny <vtrefny@redhat.com>
Date: Mon, 12 Feb 2024 14:49:23 +0100
Subject: [PATCH] Fix UnboundLocalError in MD populator
Follow-up for a73bb08255a97cf4f16c764ef09341a2421318d6
---
blivet/populator/helpers/mdraid.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/blivet/populator/helpers/mdraid.py b/blivet/populator/helpers/mdraid.py
index 22ca5195..c552aace 100644
--- a/blivet/populator/helpers/mdraid.py
+++ b/blivet/populator/helpers/mdraid.py
@@ -60,6 +60,8 @@ class MDDevicePopulator(DevicePopulator):
# try to get the device again now that we've got all the parents
if name:
device = self._devicetree.get_device_by_device_id("MDRAID-" + name, incomplete=flags.allow_imperfect_devices)
+ else:
+ device = None
if device is None:
try:
--
2.43.0

View File

@ -5,7 +5,7 @@ Version: 3.9.0
#%%global prerelease .b2
# prerelease, if defined, should be something like .a1, .b1, .b2.dev1, or .c2
Release: 2%{?prerelease}%{?dist}
Release: 3%{?prerelease}%{?dist}
Epoch: 1
License: LGPL-2.1-or-later
%global realname blivet
@ -18,6 +18,7 @@ Patch0: 0001-remove-btrfs-plugin.patch
%endif
Patch1: 0002-Fix-crash-when-scanning-degraded-not-fully-assembled.patch
Patch2: 0003-Fix-UnboundLocalError-in-MD-populator.patch
# Versions of required components (done so we make sure the buildrequires
# match the requires versions of things).
@ -116,6 +117,9 @@ make DESTDIR=%{buildroot} install
%{python3_sitelib}/*
%changelog
* Mon Feb 12 2024 Vojtech Trefny <vtrefny@redhat.com> - 3.9.0-3
- Fix UnboundLocalError in MD populator (#2263668)
* Tue Feb 06 2024 Vojtech Trefny <vtrefny@redhat.com> - 3.9.0-2
- Fix crash when scanning degraded/not fully assembled MD arrays