Current File : //usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/sos_extras.cpython-312.pyc
�

-�_g���<�ddlZddlZddlmZmZGd�dee�Zy)�N)�Plugin�IndependentPluginc�&�eZdZdZ	dZdZefZd�Zy)�	SosExtrasz/Collect extra data defined in /etc/sos/extras.d�
sos_extrasz/etc/sos/extras.d/c��	tj|j�}|jdk7s:|jtj
zs|jtjzr |jd|j�d��y	tj|j�D�]
\}}}|D�]}|j||�}|jd|���	t|dd�	�5}|j�j�D]�}t|j��dk(s|j!d
�r�1|j!d�rI|j�}	d}
t|	�dkDr	t#|	d�}
|j'|	ddd|
����|j)||����	ddd�����y#t$r"|jd|j�d��YywxYw#t$$r|jd
|�d|�d��Y��wxYw#1swY�exYw#t*$r|jd|���Y���wxYw)NrzSkipping sos extras as z' has too wide permissions or ownership.zcan't stat z, skipping sos extrasz!Collecting data from extras file �rzUTF-8)�encoding�#�:�zCan't decode size limit on linez in z, using default)�	sizelimit)�subdirzunable to read extras file )�os�stat�
extras_dir�st_uid�st_mode�S_IWGRP�S_IWOTH�	_log_warn�OSError�walk�	path_join�open�read�
splitlines�len�split�
startswith�int�
ValueError�
add_copy_spec�add_cmd_output�IOError)�self�st_res�path�_�filelist�file�_file�sfile�line�words�limits           �?/usr/lib/python3/dist-packages/sos/report/plugins/sos_extras.py�setupzSosExtras.setup.s?��
	��W�W�T�_�_�-�F��
�
��"�������(E�������-����!8����8I�JE� E�F��.�"$������!9�	J��D�!�X� �
J�����t�T�2�����!B�5�'�J�K�J��e�S�7�;�G�u�$)�J�J�L�$;�$;�$=�G�D�"�4�:�:�<�0�A�5�����9M� (� $���s�3�(,�
�
���(,��#&�u�:��>�%*�03�E�!�H�
��!%� 2� 2�5��8�A�B�<�=B�!3�!D�!%� 3� 3�D�� 3� F�+G�G��	
J�	J���	��N�N�[����(9�:%�%�
&��	��.,6�%*�(,���.M�/3�f�D����-P�)*�%*��G�G��0�J��N�N�%@���#H�I�J�sa�BF<�H�-BH�/G*�=/H�-H�<(G'�&G'�*!H�H�
H�H�H�H�H>�=H>N)�__name__�
__module__�__qualname__�
short_desc�plugin_namer�filesr2��r1rrs%��B�J��,�K�%�J�
�M�E�+Jr:r)rr�sos.report.pluginsrrrr9r:r1�<module>r<s#��
��8�KJ��)�KJr: