HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/grains/__pycache__/extra.cpython-310.pyc
o

�N�g>�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddl	ZdgZ
e�e�Z
dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�ZdS)�N�*cCs0tjj��rd}d}nd}d}dtj�||�iS)z8
    Return the default shell to use on this system
    ZCOMSPECzC:\Windows\system32\cmd.exeZSHELLz/bin/sh�shell)�salt�utils�platformZ
is_windows�os�environ�get)Zenv_var�default�r�E/opt/saltstack/salt/lib/python3.10/site-packages/salt/grains/extra.pyrsrc	Cs8dtvriStj�td�r,tjj��r"tj�tddtdd�}n/tj�tdd�}n%tjj��rDtj�tj�	td�dtdd�}n
tj�tj�	td�d�}tj�
|�r�t�d|�tjj
�|d��-}ztjj�tjj�|��WWd�Sty�t�d�iYWd�Sw1s�wYiS)	z2
    Return the grains set in the grains file
    Z	conf_filezproxy.d�id�grainszLoading static grains from %s�rbNz$Bad syntax in grains file! Skipping.)Z__opts__r�path�isdirrrrZis_proxy�join�dirname�isfile�log�debug�files�fopen�data�decodeZyamlZ	safe_load�	Exception�warning)ZgfnZfp_rrr�config s:���
��rcCs�d}dtj�|�krt�tj�|d��}n
t�tj�|d��}t|�dkrYz)tjj�	|dd��}|�
�dd	�d
k}Wd	�W|S1sGwYW|StyXY|Sw|S)z!Detect if secure-boot is enabled.FZefivarszSecureBoot-*zSecureBoot-*/data�rr���N�)rr�basename�globr�lenrrrr�read�PermissionError)�efivars_dir�enabledZsboot�fdrrr�
__secure_bootBs"����r)cCstttjjddg�d�}|S)z=
    Provide paths for secure boot directories and files
    z/sys/firmware/efi/efivarsz/sys/firmware/efi/varsN)�next�filterrr�exists)Zefivars_pathrrr�get_secure_boot_pathUs
�r-cCs$t�}t|�|rt|�ndd�}|S)zPopulate UEFI grains.F)Zefizefi-secure-boot)r-�boolr))r&rrrr�uefi`s
�r/cCsdttjj�d��iS)z)Determine if the system is transactional.�
transactionalztransactional-update)r.rrr�whichrrrrr0ksr0)r"�loggingrZ
salt.utilsrZsalt.utils.dataZsalt.utils.filesZsalt.utils.pathZsalt.utils.platformZsalt.utils.yamlZ__proxyenabled__�	getLogger�__name__rrrr)r-r/r0rrrr�<module>s"
"