def distrib_id():
 with settings(hide('running', 'stdout')):
  kernel = run('uname -s')
  if (kernel == 'Linux'):
   if is_file('/usr/bin/lsb_release'):
    id_ = run('lsb_release --id --short')
    if (id in ['arch', 'Archlinux']):
     id_ = 'Arch'
    return id_
    if (id in ['SUSE LINUX', 'openSUSE project']):
     id_ = 'SUSE'
   elif is_file('/etc/debian_version'):
    return 'Debian'
   elif is_file('/etc/fedora-release'):
    return 'Fedora'
   elif is_file('/etc/arch-release'):
    return 'Arch'
   elif is_file('/etc/redhat-release'):
    release = run('cat /etc/redhat-release')
    if release.startswith('Red Hat Enterprise Linux'):
     return 'RHEL'
    elif release.startswith('CentOS'):
     return 'CentOS'
    elif release.startswith('Scientific Linux'):
     return 'SLES'
   elif is_file('/etc/gentoo-release'):
    return 'Gentoo'
  elif (kernel == 'SunOS'):
   return 'SunOS'

def distrib_id ( ) : with settings ( hide ( 'running' , 'stdout' ) ) : kernel = run ( 'uname -s' ) if ( kernel == 'Linux' ) : if is_file ( '/usr/bin/lsb_release' ) : id_ = run ( 'lsb_release --id --short' ) if ( id in [ 'arch' , 'Archlinux' ] ) : id_ = 'Arch' return id_ if ( id in [ 'SUSE LINUX' , 'openSUSE project' ] ) : id_ = 'SUSE' elif is_file ( '/etc/debian_version' ) : return 'Debian' elif is_file ( '/etc/fedora-release' ) : return 'Fedora' elif is_file ( '/etc/arch-release' ) : return 'Arch' elif is_file ( '/etc/redhat-release' ) : release = run ( 'cat /etc/redhat-release' ) if release . startswith ( 'Red Hat Enterprise Linux' ) : return 'RHEL' elif release . startswith ( 'CentOS' ) : return 'CentOS' elif release . startswith ( 'Scientific Linux' ) : return 'SLES' elif is_file ( '/etc/gentoo-release' ) : return 'Gentoo' elif ( kernel == 'SunOS' ) : return 'SunOS'
get the os distribution id .