1 Star 0 Fork 97

王策/anaconda

forked from src-openEuler/anaconda 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
fix-remove-unknow-partition-is-sda-failed.patch 1.92 KB
一键复制 编辑 原始数据 按行查看 历史
From ad48d3ab850c9dd40908a51eae3580fcc148e171 Mon Sep 17 00:00:00 2001
From: xqrustc2020 <69908158+xqrustc2020@users.noreply.github.com>
Date: Tue, 29 Sep 2020 13:16:43 +0800
Subject: [PATCH] fix remove unkown partition in sda failed
fix: cannot create partition when sda exists a ext4 filesystem.
When you clicked the "-" button, only the format on sda should be
destroyed without removing sda from the device tree, but sda
was also destroyed. As a result, sda cannot be found during disk
initialization and an error was reported.
Resolves: rhbz#1878661
---
.../modules/storage/partitioning/interactive/utils.py | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/pyanaconda/modules/storage/partitioning/interactive/utils.py b/pyanaconda/modules/storage/partitioning/interactive/utils.py
index b52876a..fe7bd59 100644
--- a/pyanaconda/modules/storage/partitioning/interactive/utils.py
+++ b/pyanaconda/modules/storage/partitioning/interactive/utils.py
@@ -1046,8 +1046,10 @@ def _destroy_device(storage, device):
:param device: an instance of a device
"""
# Remove the device.
- if device.is_disk and device.partitioned and not device.format.supported:
- storage.recursive_remove(device)
+ if device.is_disk:
+ if device.partitioned and not device.format.supported:
+ storage.recursive_remove(device)
+ storage.initialize_disk(device)
elif device.direct and not device.isleaf:
# We shouldn't call this method for with non-leaf devices
# except for those which are also directly accessible like
@@ -1057,10 +1059,6 @@ def _destroy_device(storage, device):
else:
storage.destroy_device(device)
- # Initialize the disk.
- if device.is_disk:
- storage.initialize_disk(device)
-
# Remove empty extended partitions.
if getattr(device, "is_logical", False):
storage.remove_empty_extended_partitions()
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wangce1988/anaconda.git
git@gitee.com:wangce1988/anaconda.git
wangce1988
anaconda
anaconda
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385