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/beacons/__pycache__/glxinfo.cpython-310.pyc
o

�N�g��@sJdZddlZddlZddlZe�e�ZdZiZ	dd�Z
dd�Zdd	�ZdS)
z[
Beacon to emit when a display is available to a linux machine

.. versionadded:: 2016.3.0
�N�glxinfocCs4tjj�d�}|durd}t�dt|�d|fStS)Nrzglxinfo is missing.zUnable to load %s beacon: %sF)�salt�utils�path�which�log�error�__virtualname__)Zwhich_result�err_msg�r�H/opt/saltstack/salt/lib/python3.10/site-packages/salt/beacons/glxinfo.py�__virtual__sr
cCs,t|t�sdStjj�|�}d|vrdSdS)z+
    Validate the beacon configuration
    )Fz0Configuration for glxinfo beacon must be a list.�user)FzYConfiguration for glxinfo beacon must include a user as glxinfo is not available to root.)TzValid beacon configuration)�
isinstance�listrr�beacons�list_to_dict)�configrrr�validates
rcCs�t�d�g}tjj�|�}tdd|ddd�}d|vr?|dr?t�dd	�}|d
k}||ks3dtvr;|�	d|d��|td<|S)a
    Emit the status of a connected display to the minion

    Mainly this is used to detect when the display fails to connect
    for whatever reason.

    .. code-block:: yaml

        beacons:
          glxinfo:
            - user: frank
            - screen_event: True

    zglxinfo beacon startingzcmd.retcodezDISPLAY=:0 glxinforT)ZrunasZpython_shellZscreen_event�screen_availableFr)�tagr)
rZtracerrrrZ__salt__�
last_state�get�append)r�ret�retcode�
last_valuerrrr�beacon0s

�r)
�__doc__�loggingZsalt.utils.beaconsrZsalt.utils.path�	getLogger�__name__rr	rr
rrrrrr�<module>s