ko.py 文件源码

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

项目:kolla-kubernetes 作者: openstack 项目源码 文件源码
def linux_ver():
    '''Determine Linux version - Ubuntu or Centos

    Fail if it is not one of those.
    Return the long string for output
    '''

    find_os = platform.linux_distribution()
    if re.search('Centos', find_os[0], re.IGNORECASE):
        linux = 'centos'
    elif re.search('Ubuntu', find_os[0], re.IGNORECASE):
        linux = 'ubuntu'
    else:
        print('Linux "%s" is not supported yet' % find_os[0])
        sys.exit(1)

    return(linux)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号