Sindbad~EG File Manager

Current Path : /lib/python3.6/site-packages/sos/report/plugins/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/sos/report/plugins/__pycache__/sos_extras.cpython-36.pyc

3

�f��@s6ddlZddlZddlmZmZGdd�dee�ZdS)�N)�Plugin�IndependentPluginc@s&eZdZdZdZdZefZdd�ZdS)�	SosExtrasz/Collect extra data defined in /etc/sos/extras.dZ
sos_extrasz/etc/sos/extras.d/c$Cs�yFtj|j�}|jdks0|jtj@s0|jtj@rD|jd|j�dSWn$tk
rj|jd|j�dSX�xNtj	|j�D�]<\}}}�x.|D�]$}|j
||�}|jd|�y�t|ddd���}x�|j�j
�D]�}t|j��dks�|jd�r�q�|jd	��rr|j�}	d}
t|	�d
k�rVyt|	d
�}
Wn.tk
�rT|jd|�d|�d
��YnX|j|	dd
d�|
d�q�|j||d�q�WWdQRXWq�tk
�r�|jd|�Yq�Xq�Wq|WdS)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�rzUTF-8)�encoding�#�:�zCan't decode size limit on linez in z, using default)Z	sizelimit)Zsubdirzunable to read extras file %s)�os�stat�
extras_dir�st_uid�st_mode�S_IWGRP�S_IWOTHZ	_log_warn�OSError�walkZ	path_join�open�read�
splitlines�len�split�
startswith�int�
ValueErrorZ
add_copy_specZadd_cmd_output�IOError)�selfZst_res�path�_Zfilelist�fileZ_fileZsfile�lineZwords�limit�r"� /usr/lib/python3.6/sos_extras.py�setup.sD


 zSosExtras.setupN)�__name__�
__module__�__qualname__Z
short_descZplugin_namer�filesr$r"r"r"r#rs
r)r
rZsos.report.pluginsrrrr"r"r"r#�<module>	s

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists