osd.py 文件源码

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

项目:DeepSea 作者: SUSE 项目源码 文件源码
def readlink(device, follow=True):
    """
    Return the short name for a symlink device
    """
    option = ''
    if follow:
        option = '-f'
    cmd = "readlink {} {}".format(option, device)
    log.info(cmd)
    proc = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True)
    proc.wait()
    result = proc.stdout.read().rstrip()
    log.debug(pprint.pformat(result))
    log.debug(pprint.pformat(proc.stderr.read()))
    return result


# pylint: disable=too-many-instance-attributes
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号