volume.py 文件源码

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

项目:charm-glusterfs 作者: openstack 项目源码 文件源码
def get_local_ip() -> Result:
    """
    Returns the local IPAddr address associated with this server
    # Failures
    Returns a GlusterError representing any failure that may have happened
    while trying to
    query this information.
    """
    ip_addr = get_host_ip(unit_get('private-address'))
    try:
        parsed = ip_address(address=ip_addr)
        return Ok(parsed)  # Resolves a str hostname into a ip address.
    except ValueError:
        return Err("failed to parse ip address: {}".format(ip_addr))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号