def get_distro()

in azurelinuxagent/common/version.py [0:0]


def get_distro():

    if 'FreeBSD' in platform.system():
        release = re.sub(r'\-.*\Z', '', ustr(platform.release()))
        osinfo = ['freebsd', release, '', 'freebsd']
    elif 'OpenBSD' in platform.system():
        release = re.sub(r'\-.*\Z', '', ustr(platform.release()))
        osinfo = ['openbsd', release, '', 'openbsd']
    elif 'Linux' in platform.system():
        osinfo = get_linux_distribution(0, 'alpine')
    elif 'NS-BSD' in platform.system():
        release = re.sub(r'\-.*\Z', '', ustr(platform.release()))
        osinfo = ['nsbsd', release, '', 'nsbsd']
    else:
        try:
            # dist() removed in Python 3.8
            osinfo = list(platform.dist()) + ['']  # pylint: disable=W1505,E1101
        except Exception:
            osinfo = ['UNKNOWN', 'FFFF', '', '']

    # The platform.py lib has issue with detecting oracle linux distribution.
    # Merge the following patch provided by oracle as a temporary fix.
    if os.path.exists("/etc/oracle-release"):
        osinfo[2] = "oracle"
        osinfo[3] = "Oracle Linux"

    if os.path.exists("/etc/euleros-release"):
        osinfo[0] = "euleros"

    if os.path.exists("/etc/UnionTech-release"):
        osinfo[0] = "uos"

    if os.path.exists("/etc/mariner-release"):
        osinfo[0] = "mariner"

    # The platform.py lib has issue with detecting BIG-IP linux distribution.
    # Merge the following patch provided by F5.
    if os.path.exists("/shared/vadc"):
        osinfo = get_f5_platform()

    if os.path.exists("/etc/cp-release"):
        osinfo = get_checkpoint_platform()

    if os.path.exists("/home/guestshell/azure"):
        osinfo = ['iosxe', 'csr1000v', '', 'Cisco IOSXE Linux']

    if os.path.exists("/etc/photon-release"):
        osinfo[0] = "photonos"

    # Remove trailing whitespace and quote in distro name
    osinfo[0] = osinfo[0].strip('"').strip(' ').lower()
    return osinfo