def pairs():
"""
Return an array of devices and paths
"""
_paths = [pathname for pathname in glob.glob("/var/lib/ceph/osd/*")]
_pairs = []
with open('/proc/mounts') as mounts:
for line in mounts:
_partition, path = line.split()[:2]
if path in _paths:
match = re.match(r'^(.+)\d+$', _partition)
device = match.group(1)
if 'nvme' in device:
device = device[:-1]
_pairs.append([device, path])
return _pairs
评论列表
文章目录