File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/grains/__pycache__/fibre_channel.cpython-310.pyc
Back
o ;j � @ s^ d Z ddlZddlZddlZddlZddlZdZe�e �Z dd� Zdd� Zdd � Z d d� ZdS )a) Grains for Fibre Channel WWN's. On Windows this runs a PowerShell command that queries WMI to get the Fibre Channel WWN's available. .. versionadded:: 2018.3.0 To enable these grains set ``fibre_channel_grains: True`` in the minion config. .. code-block:: yaml fibre_channel_grains: True � NZ fibre_channelc C s t �dd�du r dS tS )NZfibre_channel_grainsF)Z__opts__�get�__virtualname__� r r �M/opt/saltstack/salt/lib/python3.10/site-packages/salt/grains/fibre_channel.py�__virtual__ s r c C st g } t � d�D ]0}tjj�|d��}|�� }|�� D ] }| �|�� dd� � qW d � n1 s2w Y q| S )z; Return Fibre Channel port WWNs from a Linux host. z/sys/class/fc_host/*/port_name�r� N) �glob�salt�utils�filesZfopen�read� splitlines�append�rstrip)�retZfc_fileZ_wwn�content�liner r r �_linux_wwns"