Hello Piotr Kliczewski, Dan Kenigsberg, Ramesh N,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/41466
to review the following change.
Change subject: gluster:fix NoneType error for some devices does not contain sysfsPath
......................................................................
gluster:fix NoneType error for some devices does not contain sysfsPath
Currently devices list returns the list of available disks and
its fs type properly. However it fails for some devices which does
not contain sysfsPath and the dev details become None.
This patch fixes this error by assigning empty dictonary if
the dev is empty or None.
Change-Id: I54efdf3958519e2ae038b527a03e0b57569c2e8f
Signed-off-by: Timothy Asir Jeyasingh <tjeyasin(a)redhat.com>
Reviewed-on:
https://gerrit.ovirt.org/41262
Reviewed-by: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Reviewed-by: Ramesh N <rnachimu(a)redhat.com>
Continuous-Integration: Jenkins CI
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/gluster/storagedev.py
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/66/41466/1
diff --git a/vdsm/gluster/storagedev.py b/vdsm/gluster/storagedev.py
index 0eea52c..583548b 100644
--- a/vdsm/gluster/storagedev.py
+++ b/vdsm/gluster/storagedev.py
@@ -79,10 +79,11 @@
info['model'] = device.type
if device.format:
info['uuid'] = device.format.uuid or ''
+ # lvm vg will not have sysfs path
if hasattr(udev, 'get_device'):
- dev = udev.get_device(device.sysfsPath)
+ dev = udev.get_device(device.sysfsPath) or {}
elif hasattr(udev, 'udev_get_device'):
- dev = udev.udev_get_device(device.sysfsPath)
+ dev = udev.udev_get_device(device.sysfsPath) or {}
else:
dev = {}
info['fsType'] = device.format.type or dev.get('ID_FS_TYPE',
'')
--
To view, visit
https://gerrit.ovirt.org/41466
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I54efdf3958519e2ae038b527a03e0b57569c2e8f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5-gluster
Gerrit-Owner: Timothy Asir <tjeyasin(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Ramesh N <rnachimu(a)redhat.com>