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

�N�g��@stdZddlZddlZddlmZdgZdZe�e	�Z
iZdd�Zdd�Z
dd	�Zd
d�Zdd
�Zdd�Zdd�ZdS)a
Generate baseline proxy minion grains for ESXi hosts.

.. Warning::
    This module will be deprecated in a future release of Salt. VMware strongly
    recommends using the
    `VMware Salt extensions <https://docs.saltproject.io/salt/extensions/salt-ext-modules-vmware/en/latest/all.html>`_
    instead of the ESXi module. Because the Salt extensions are newer and
    actively supported by VMware, they are more compatible with current versions
    of ESXi and they work well with the latest features in the VMware product
    line.


�N)�SaltSystemExit�esxicCsBddl}z|jj�td�rddl}tWSWdSty YdSw)NrrF)�salt.utils.proxy�utils�proxyZis_proxytypeZ__opts__Zsalt.modules.vsphere�__virtualname__�KeyError)�salt�r
�D/opt/saltstack/salt/lib/python3.10/site-packages/salt/grains/esxi.py�__virtual__s���rcCst�S)N)�_grainsr
r
r
rr.scC�ddiS)N�kernelrr
r
r
r
rr2�rcCs<tst�t��zdt�d�iWStyddiYSw)N�osZfullNameZUnknown)�GRAINS_CACHE�updater
�get�AttributeErrorr
r
r
rr6s�rcCr)N�	os_familyrr
r
r
r
rr@rrc
Csztd�dd�g}tdd}|D]'}|D]"}ztjjj|||d�}Wn	ty,Yqw|r7||fSqqtd��)z]
    Cycle through all the possible credentials and return the first one that
    works.
    r�username�root�	passwords)�hostr�passwordz@Cannot complete login due to an incorrect user name or password.)�
__pillar__rr	�modules�vsphere�system_infor)rZ
user_namesr�userr�retr
r
r�_find_credentialsDs$
����
�r"cCs|z3tdd}|r1t|�\}}td�d�}td�d�}tjjj|||||d�}t�|�WtSWtSt	y=YtSw)z1
    Get the grains from the proxied device.
    rr�protocol�port)rrrr#r$)
rr"rr	rrrrrr)rrrr#r$r!r
r
rr
^s*����r
)�__doc__�loggingrr	Zsalt.exceptionsrZ__proxyenabled__r�	getLogger�__file__�logrrrrrrr"r
r
r
r
r�<module>s