neil / rpms / python-blivet

Forked from rpms/python-blivet a year ago
Clone
Blob Blame History Raw
From 72ace5d66b567baefde10ff9c4197054830067f1 Mon Sep 17 00:00:00 2001
From: Vojtech Trefny <vtrefny@redhat.com>
Date: Thu, 28 Apr 2022 14:13:04 +0200
Subject: [PATCH] Do not crash when changing disklabel on disks with active
 devices

The _find_active_devices_on_action_disks function originally
prevented from making any changes on disks with active devices
(active LVs, mounted partitions etc.)  This was changed in
b72e957d2b23444824316331ae21d1c594371e9c and the check currently
prevents only reformatting the disklabel on such disks which
should be already impossible on disks with an existing partition.

This change for the 3.4 stable branch keeps the current behaviour
where the active devices are teared down when running in installer
mode to avoid potential issues with the installer.

Resolves: rhbz#2078803
---
 blivet/actionlist.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/blivet/actionlist.py b/blivet/actionlist.py
index f3977401..9c06228b 100644
--- a/blivet/actionlist.py
+++ b/blivet/actionlist.py
@@ -211,9 +211,8 @@ class ActionList(object):
                     except StorageError as e:
                         log.info("teardown of %s failed: %s", device.name, e)
             else:
-                raise RuntimeError("partitions in use on disks with changes "
-                                   "pending: %s" %
-                                   ",".join(problematic))
+                log.debug("ignoring devices in use on disks with changes: %s",
+                          ",".join(problematic))
 
         log.info("resetting parted disks...")
         for device in devices:
-- 
2.34.3