HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/platform.cpython-310.pyc
o

�N�gu�@s&dZddlZddlZddlZddlZddlZddlZddlZddlm	Z
d+dd�Ze
dd��Ze
d	d
��Z
e
dd��Ze
d
d��Ze
dd��Ze
dd��Ze
dd��Ze
dd��Ze
dd��Ze
dd��Ze
dd��Ze
dd��Ze
dd ��Ze
d!d"��Ze
d#d$��Ze
d%d&��Zd'd(�Zd)d*�ZdS),z7
Functions for identifying which platform a machine is
�N)�memoizeTcCs�|rt��}nt��}d}}t�tj��tjdd�}Wd�n1s&wYt�tj��t��}Wd�n1s@wY|||fS)zg
    Simple function to return information about the OS distribution (id_name, version, codename).
    �T)ZbestN)	�distro�name�id�
contextlib�suppress�
subprocess�CalledProcessError�versionZcodename)Zfull_distribution_nameZdistro_nameZdistro_versionZdistro_codename�r�G/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/platform.py�linux_distributions
�
�
rcC�tj�d�S)z?
    Simple function to return if a host is Windows or not
    �win��sys�platform�
startswithrrrr
�
is_windows"�rcCsPddl}d}zd|jvstdd�tjD��rd}W|SW|Sty'Y|Sw)z�
    Return True if this minion is a proxy minion.
    Leverages the fact that is_linux() and is_windows
    both return False for proxies.
    TODO: Need to extend this for proxies that might run on
    other Unices
    rNF�proxycss�|]
}|�d�r|VqdS)z	--proxyidN)r)�.0�argrrr
�	<genexpr>?s�
�
�zis_proxy.<locals>.<genexpr>T)�__main__�__file__�anyr�argv�AttributeError)�main�retrrr
�is_proxy*s	����r"cCr)z|
    Simple function to return if a host is Linux or not.
    Note for a proxy minion, we need to return something else
    �linuxrrrrr
�is_linuxHsr$cCr)zF
    Simple function to return if a host is Darwin (macOS) or not
    �darwinrrrrr
�	is_darwinQrr&cCr)z;
    Simple function to return if host is SunOS or not
    Zsunosrrrrr
�is_sunosYrr'cCst�sdSt��d�d�S)zG
    Simple function to return if host is SmartOS (Illumos) or not
    F�Zjoyent_)r'�os�unamerrrrr
�
is_smartosasr+cCspt�sdSztjdgtjtjd�}|��d���t�}|�	�}Wn
t
y+YdSw|r0dS|dkr6dSdS)zL
    Function to return if host is SmartOS (Illumos) global zone or not
    F�zonename��stdout�stderrr�globalT�r+r	�Popen�PIPE�STDOUT�communicate�strip�decode�__salt_system_encoding__�poll�OSError�Z
zonename_procZzonename_outputZzonename_retcoderrr
�is_smartos_globalzonel�&���r<cCspt�sdSztjdgtjtjd�}|��d���t�}|�	�}Wn
t
y+YdSw|r0dS|dkr6dSdS)zH
    Function to return if host is SmartOS (Illumos) and not the gz
    Fr,r-rr0Tr1r;rrr
�is_smartos_zone�r=r>cCstj�d�o
t��j�d�S)z;
    Simple function to return if host is Junos or not
    �freebsdZJNPR)rrrr)r*�releaserrrr
�is_junos�srAcCr)z=
    Simple function to return if host is FreeBSD or not
    r?rrrrr
�
is_freebsd�rrBcCr)z<
    Simple function to return if host is NetBSD or not
    Znetbsdrrrrr
�	is_netbsd�rrCcCr)z=
    Simple function to return if host is OpenBSD or not
    Zopenbsdrrrrr
�
is_openbsd�rrDcCr)z9
    Simple function to return if host is AIX or not
    �aixrrrrr
�is_aix�rrFcC�dd�t�D�\}}}|dkS)z<
    Simple function to return if host is Fedora or not
    cs� �|]}|�d��d�VqdS��"�'N�r6�r�xrrr
r���
�zis_fedora.<locals>.<genexpr>ZFedora�r�ZosnameZ	osreleaseZ
oscodenamerrr
�	is_fedora���rRcCrG)z?
    Simple function to return if host is Photon OS or not
    csrHrIrLrMrrr
r�rOzis_photonos.<locals>.<genexpr>zVMware Photon OSrPrQrrr
�is_photonos�rSrTcCs"t�r
t���d�St���d�S)z=
    Simple function to return if host is AArch64 or not
    �arm64�aarch64)r&r�machinerrrrr
�
is_aarch64�srXcCstjdd�dkS)z�
    Returns True if multiprocessing.get_start_method(allow_none=False) returns "spawn"

    This is the default for Windows Python >= 3.4 and macOS on Python >= 3.8.
    Salt, however, will force macOS to spawning by default on all python versions
    F)Z
allow_noneZspawn)�multiprocessingZget_start_methodrrrr
�spawning_platform�srZcCsbddg}dd�|D�}|siSt|dtd��}d|����iWd�S1s*wYdS)	zG
    Provide the machine-id for machine/virtualization combination
    z/etc/machine-idz/var/lib/dbus/machine-idcSsg|]
}tj�|�r|�qSr)r)�path�exists)r�locrrr
�
<listcomp>sz*get_machine_identifier.<locals>.<listcomp>r)�encodingZ
machine_idN)�openr8�readr6)Z	locationsZexisting_locationsZ	machineidrrr
�get_machine_identifier�s�$�rb)T)�__doc__rrYr)rr	rrZsalt.utils.decoratorsrZreal_memoizerrr"r$r&r'r+r<r>rArBrCrDrFrRrTrXrZrbrrrr
�<module>sX