Jan Pokorny a25a6f
From 72ace5d66b567baefde10ff9c4197054830067f1 Mon Sep 17 00:00:00 2001
Jan Pokorny a25a6f
From: Vojtech Trefny <vtrefny@redhat.com>
Jan Pokorny a25a6f
Date: Thu, 28 Apr 2022 14:13:04 +0200
Jan Pokorny a25a6f
Subject: [PATCH] Do not crash when changing disklabel on disks with active
Jan Pokorny a25a6f
 devices
Jan Pokorny a25a6f
Jan Pokorny a25a6f
The _find_active_devices_on_action_disks function originally
Jan Pokorny a25a6f
prevented from making any changes on disks with active devices
Jan Pokorny a25a6f
(active LVs, mounted partitions etc.)  This was changed in
Jan Pokorny a25a6f
b72e957d2b23444824316331ae21d1c594371e9c and the check currently
Jan Pokorny a25a6f
prevents only reformatting the disklabel on such disks which
Jan Pokorny a25a6f
should be already impossible on disks with an existing partition.
Jan Pokorny a25a6f
Jan Pokorny a25a6f
This change for the 3.4 stable branch keeps the current behaviour
Jan Pokorny a25a6f
where the active devices are teared down when running in installer
Jan Pokorny a25a6f
mode to avoid potential issues with the installer.
Jan Pokorny a25a6f
Jan Pokorny a25a6f
Resolves: rhbz#2078803
Jan Pokorny a25a6f
---
Jan Pokorny a25a6f
 blivet/actionlist.py | 5 ++---
Jan Pokorny a25a6f
 1 file changed, 2 insertions(+), 3 deletions(-)
Jan Pokorny a25a6f
Jan Pokorny a25a6f
diff --git a/blivet/actionlist.py b/blivet/actionlist.py
Jan Pokorny a25a6f
index f3977401..9c06228b 100644
Jan Pokorny a25a6f
--- a/blivet/actionlist.py
Jan Pokorny a25a6f
+++ b/blivet/actionlist.py
Jan Pokorny a25a6f
@@ -211,9 +211,8 @@ class ActionList(object):
Jan Pokorny a25a6f
                     except StorageError as e:
Jan Pokorny a25a6f
                         log.info("teardown of %s failed: %s", device.name, e)
Jan Pokorny a25a6f
             else:
Jan Pokorny a25a6f
-                raise RuntimeError("partitions in use on disks with changes "
Jan Pokorny a25a6f
-                                   "pending: %s" %
Jan Pokorny a25a6f
-                                   ",".join(problematic))
Jan Pokorny a25a6f
+                log.debug("ignoring devices in use on disks with changes: %s",
Jan Pokorny a25a6f
+                          ",".join(problematic))
Jan Pokorny a25a6f
 
Jan Pokorny a25a6f
         log.info("resetting parted disks...")
Jan Pokorny a25a6f
         for device in devices:
Jan Pokorny a25a6f
-- 
Jan Pokorny a25a6f
2.34.3
Jan Pokorny a25a6f