osd.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:DeepSea 作者: SUSE 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号