HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/sos_extras.cpython-310.pyc
o

i��d��@s6ddlmZmZddlZddlZGdd�dee�ZdS)�)�Plugin�IndependentPluginNc@s(eZdZdZ	dZdZefZdd�ZdS)�	SosExtrasz/Collect extra data defined in /etc/sos/extras.d�
sos_extrasz/etc/sos/extras.d/c
Cs�z$t�|j�}|jdks|jtj@s|jtj@r#|�d|j�WdSWnty6|�d|j�YdSwt�	|j�D]�\}}}|D]{}|�
||�}|�d|�z\t|����
�D]Q}t|���dksk|�d�rlq\|�d�r�|��}d}	t|�dkr�zt|d�}	Wnty�|�d||f�Ynw|j|ddd�|	d	�q\|j||d
�q\WqDty�|�d|�YqDwq=dS)Nrz@Skipping sos extras as %s has too wide permissions or ownership.z"can't stat %s, skipping sos extrasz#Collecting data from extras file %s�#�:�zFCan't decode integer sizelimit on line '%s' in file %s, using default.)�	sizelimit)�subdirzunable to read extras file %s)�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�path�dirlist�filelist�f�_file�line�words�limit�r+�?/usr/lib/python3/dist-packages/sos/report/plugins/sos_extras.py�setup.sV
�����

������zSosExtras.setupN)�__name__�
__module__�__qualname__�
short_desc�plugin_namer
�filesr-r+r+r+r,rsr)�sos.report.pluginsrrrrrr+r+r+r,�<module>s