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__/fx2.cpython-310.pyc
o

�N�gB�@s�dZddlZddlZddlZddlZddlZdgZdZe�	e
�ZiZdd�Z
dd�Zdd	�Zd
d�Zdd�Zd
d�Zdd�Zdd�ZdS)a

Generate baseline proxy minion grains for Dell FX2 chassis.
The challenge is that most of Salt isn't bootstrapped yet,
so we need to repeat a bunch of things that would normally happen
in proxy/fx2.py--just enough to get data from the chassis to include
in grains.
�N�fx2cCs.tjj��rdtvrtd�d�dkrtSdS)N�proxyZ	proxytyperF)�salt�utils�platformZis_proxy�__opts__�get�__virtualname__�r
r
�C/opt/saltstack/salt/lib/python3.10/site-packages/salt/grains/fx2.py�__virtual__s
�rc
Cs�g}|�td�dd��dt�d�vr|�td�d��|D]U}tddD]L}tjjjtdd||d�}z|�dd	�d	urV|tdd<|tdd
<||fWSWq(tyt|tdd<|tdd
<||fYSwq t	�
d�dS)
z\
    Cycle through all the possible credentials and return the first one that
    works
    r�admin_username�rootZfallback_admin_usernameZ	passwords�host�rr
�admin_password�retcodeNrzJgrains fx2.find_credentials found no valid credentials, using Dell default)rZcalvin)�append�
__pillar__rr�modules�dracrZget_chassis_namer�AttributeError�logger�debug)Z	usernames�user�pwd�rr
r
r�_find_credentials$s6
�����rcCsft�\}}tjjjtdd||d�}|�dd�dkr|}ni}|�tjjjtdd||d��|S)z0
    Get the grains from the proxied device
    rrrrr)	rrrrZsystem_inforr�updateZ	inventory)�username�passwordr�GRAINS_CACHEr
r
r�_grainsHs"

�
��r"cCst�S)N)r"r
r
r
rrcscC�ddiS)N�kernelrr
r
r
r
rr$g�r$cCsBtst�t��zdt�d��d�iWSty ddiYSw)N�locationzChassis InformationzChassis Location�Unknown)r!rr"rrr
r
r
rr&ks��r&cCr#)N�	os_familyrr
r
r
r
rr(wr%r(cCr#)N�os_datar'r
r
r
r
rr){r%r))�__doc__�loggingZsalt.modules.cmdmodrZsalt.modules.dracrZsalt.proxy.fx2Zsalt.utils.platformZ__proxyenabled__r	�	getLogger�__file__rr!rrr"rr$r&r(r)r
r
r
r�<module>s$

$