31 lines
935 B
Diff
31 lines
935 B
Diff
From ceeb75df8362f848cd2c11caaba04c5efdc4629d Mon Sep 17 00:00:00 2001
|
|
From: Vojtech Trefny <vtrefny@redhat.com>
|
|
Date: Thu, 30 Jul 2020 12:36:35 +0200
|
|
Subject: [PATCH] Fix reading hidden sysfs attribute
|
|
|
|
util.get_sysfs_attr returns a string so bool(hidden) is always
|
|
True and we hide all devices.
|
|
|
|
Reference:https://github.com/storaged-project/blivet/commit/191a6961f13bd868052346047d0c1dc24b19f09e
|
|
Conflict:NA
|
|
---
|
|
blivet/udev.py | 5 ++++-
|
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/blivet/udev.py b/blivet/udev.py
|
|
index 8b3fc58..5788a5e 100644
|
|
--- a/blivet/udev.py
|
|
+++ b/blivet/udev.py
|
|
@@ -1004,4 +1004,7 @@ def device_is_nvdimm_namespace(info):
|
|
def device_is_hidden(info):
|
|
sysfs_path = device_get_sysfs_path(info)
|
|
hidden = util.get_sysfs_attr(sysfs_path, "hidden")
|
|
- return bool(hidden)
|
|
+ if not hidden or not hidden.isnumeric():
|
|
+ return False
|
|
+
|
|
+ return bool(int(hidden))
|
|
--
|
|
2.27.0
|
|
|