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)
评论列表
文章目录