9 Star 0 Fork 24

src-openEuler/python-blivet

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Ignore-invalid-empty-UUIDs-for-NVMe-namespaces.patch 1.33 KB
一键复制 编辑 原始数据 按行查看 历史
sun_hai 提交于 2024-04-15 12:17 +08:00 . Ignore invalid/empty UUIDs for NVMe namespaces
From 8f61c9ba7241daa6b068355eafb39b1711b12371 Mon Sep 17 00:00:00 2001
From: Vojtech Trefny <vtrefny@redhat.com>
Date: Wed, 10 Apr 2024 13:41:35 +0200
Subject: [PATCH] Ignore invalid/empty UUIDs for NVMe namespaces
Fixes: #1221
---
blivet/populator/helpers/disk.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/blivet/populator/helpers/disk.py b/blivet/populator/helpers/disk.py
index 4a7daa1d1..3ac3f4089 100644
--- a/blivet/populator/helpers/disk.py
+++ b/blivet/populator/helpers/disk.py
@@ -27,6 +27,8 @@
from gi.repository import BlockDev as blockdev
from gi.repository import GLib
+import uuid
+
from ... import udev
from ... import util
from ...devices import DASDDevice, DiskDevice, FcoeDiskDevice, iScsiDiskDevice
@@ -257,10 +259,14 @@ def _get_kwargs(self):
log.debug("Failed to get namespace info for %s: %s", path, str(err))
else:
kwargs["nsid"] = ninfo.nsid
- kwargs["uuid"] = ninfo.uuid
kwargs["eui64"] = ninfo.eui64
kwargs["nguid"] = ninfo.nguid
+ if ninfo.uuid and ninfo.uuid != uuid.UUID(int=0):
+ kwargs["uuid"] = ninfo.uuid
+ else:
+ kwargs["uuid"] = None
+
log.info("%s is an NVMe local namespace device", udev.device_get_name(self.data))
return kwargs
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/python-blivet.git
git@gitee.com:src-openeuler/python-blivet.git
src-openeuler
python-blivet
python-blivet
master

搜索帮助