def detect_distro_type():
 if os.path.exists('/etc/redhat-release'):
  return 'redhat'
 elif os.path.exists('/etc/debian_version'):
  return 'debian'
 elif os.path.exists('/etc/SuSE-release'):
  return 'suse'
 else:
  return None

def detect_distro_type ( ) : if os . path . exists ( '/etc/redhat-release' ) : return 'redhat' elif os . path . exists ( '/etc/debian_version' ) : return 'debian' elif os . path . exists ( '/etc/SuSE-release' ) : return 'suse' else : return None
simple distro detection based on release/version files .