From: "Brian C. Lane" <bcl(a)redhat.com>
sysfs paths may, for whatever reason, not exist. Return '0' for int()
instead of None if this is the case.
Resolves: rhbz#1265090
---
blivet/devices/storage.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/blivet/devices/storage.py b/blivet/devices/storage.py
index 3938ab2..21c0d1a 100644
--- a/blivet/devices/storage.py
+++ b/blivet/devices/storage.py
@@ -620,7 +620,7 @@ def readCurrentSize(self):
size = Size(0)
if self.exists and os.path.exists(self.path) and \
os.path.isdir(self.sysfsPath):
- blocks = int(util.get_sysfs_attr(self.sysfsPath, "size"))
+ blocks = int(util.get_sysfs_attr(self.sysfsPath, "size") or
'0')
size = Size(blocks * LINUX_SECTOR_SIZE)
self._mockPartedDevice(size)
--
To view this commit on github, visit
https://github.com/rhinstaller/blivet/commit/dad91a809fec106761741d4d64fd...