The following:
```
is_part = get_file_contents(os.path.join(_sys_dev_block_path, item, 'partition')) == "1"
```
assumes any `/sys/dev/block/x:y/partition` contains '1' which is wrong.
This file actually contains the corresponding partition number.
Fixes: https://tracker.ceph.com/issues/64195
Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
(cherry picked from commit
d5d2d1456542829495d3ebbbad6ca2febd7c344d)
self._is_lvm_member = None
self.ceph_device = False
self._parse()
- self.device_nodes = sys_info.devices[self.path]['device_nodes']
+ if self.path in sys_info.devices.keys():
+ self.device_nodes = sys_info.devices[self.path]['device_nodes']
self.lsm_data = self.fetch_lsm(with_lsm)
self.available_lvm, self.rejected_reasons_lvm = self._check_lvm_reject_reasons()
sysdir = os.path.join(_sys_block_path, devname)
if block[2] == 'part':
sysdir = os.path.join(_sys_block_path, block[3], devname)
+ metadata = {}
# If the device is ceph rbd it gets excluded
if is_ceph_rbd(diskname):