mirror of
https://github.com/ceph/ceph
synced 2025-02-23 02:57:21 +00:00
ceph-volume: fix is_ceph_disk_member()
`dev['NAME']` can't match `part` given that it's the name of the parent device being compared to the partition name. Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
This commit is contained in:
parent
0ee8351e4d
commit
24899a1f8d
@ -408,11 +408,14 @@ class Device(object):
|
||||
# If we come from Devices(), self.lsblk_all is set already.
|
||||
# Otherwise, we have to grab the data.
|
||||
details = self.lsblk_all or disk.lsblk_all()
|
||||
_is_member = False
|
||||
if self.sys_api.get("partitions"):
|
||||
for part in self.sys_api.get("partitions").keys():
|
||||
for dev in details:
|
||||
if dev['NAME'] == part:
|
||||
return is_member(dev)
|
||||
if part.startswith(dev['NAME']):
|
||||
if is_member(dev):
|
||||
_is_member = True
|
||||
return _is_member
|
||||
else:
|
||||
return is_member(self.disk_api)
|
||||
raise RuntimeError(f"Couln't check if device {self.path} is a ceph-disk member.")
|
||||
|
Loading…
Reference in New Issue
Block a user