1 Star 0 Fork 105

王策/anaconda

forked from src-openEuler/anaconda 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bugfix-Fix-issue-when-ns_info-cannot-be-retrieved-for-NVDim.patch 1.81 KB
一键复制 编辑 原始数据 按行查看 历史
From 49f6e0e64accb5a1e6590bb08f7986fe7eaec2de Mon Sep 17 00:00:00 2001
From: Jiri Konecny <jkonecny@redhat.com>
Date: Thu, 29 Oct 2020 10:08:09 +0100
Subject: [PATCH] Fix issue when ns_info cannot be retrieved for NVDimm
namespace
If we don't skip this part the uncaught exception will raise because we
are
trying to concatenate string and None types.
This is happening when NVDIMM namespace is set to DEVDAX mode. In this
mode
there is no device to be returned so we will got None from blivet.
Resolves: rhbz#1891827
(cherry picked from commit 6afc375b164a802e26802ec4ba54d3446c078091)
---
pyanaconda/modules/storage/nvdimm/nvdimm.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/modules/storage/nvdimm/nvdimm.py b/pyanaconda/modules/storage/nvdimm/nvdimm.py
index 4476dd1..5b9c9dc 100644
--- a/pyanaconda/modules/storage/nvdimm/nvdimm.py
+++ b/pyanaconda/modules/storage/nvdimm/nvdimm.py
@@ -101,6 +101,12 @@ class NVDIMMModule(KickstartBaseModule):
devices_to_ignore = set()
for ns_name, ns_info in nvdimm.namespaces.items():
+ # this is happening when namespace is set to DEVDAX mode - block device is not present
+ if ns_info.blockdev is None:
+ log.debug("%s will be skipped - NVDIMM namespace block device information "
+ "can't be retrieved", ns_name)
+ continue
+
info = udev.get_device(device_node="/dev/" + ns_info.blockdev)
if info and udev.device_get_format(info) == "iso9660":
@@ -116,8 +122,7 @@ class NVDIMMModule(KickstartBaseModule):
else:
continue
- if ns_info.blockdev:
- devices_to_ignore.add(ns_info.blockdev)
+ devices_to_ignore.add(ns_info.blockdev)
return devices_to_ignore
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wangce1988/anaconda.git
git@gitee.com:wangce1988/anaconda.git
wangce1988
anaconda
anaconda
master

搜索帮助