Your IP : 216.73.217.13


Current Path : /lib/python3/dist-packages/sos/cleaner/archives/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/sos/cleaner/archives/__pycache__/sos.cpython-38.pyc

U

���b�
�@s`ddlmZddlZddlZGdd�de�ZGdd�de�ZGdd�de�ZGd	d
�d
e�ZdS)�)�SoSObfuscationArchiveNc	@sBeZdZdZdZdZddgdddd	d
ddd
gd�Zedd��ZdS)�SoSReportArchivez�This is the class representing an sos report, or in other words the
    type the archive the SoS project natively generates
    �reportzsos report archivezsos_commands/host/hostnamez	etc/hostsz"sos_commands/networking/ip_-o_addrz%sos_commands/networking/ip_-d_addressz(sos_commands/login/lastlog_-u_1000-60000z)sos_commands/login/lastlog_-u_60001-65536z.sos_commands/login/lastlog_-u_65537-4294967295zsos_commands/login/lastzetc/cron.allowz
etc/cron.deny)ZhostnameZipZmacZusernamecCs0zt�|�od|kWStk
r*YdSXdS)N�
sosreport-F��tarfile�
is_tarfile�	Exception��cls�arc_path�r
�:/usr/lib/python3/dist-packages/sos/cleaner/archives/sos.py�
check_is_type,szSoSReportArchive.check_is_typeN)	�__name__�
__module__�__qualname__�__doc__�	type_name�descriptionZ
prep_files�classmethodrr
r
r
rrs$���rc@s$eZdZdZdZdZedd��ZdS)�SoSReportDirectoryz�This is the archive class representing a build directory, or in other
    words what `sos report --clean` will end up using for in-line obfuscation
    Z
report_dirzsos report directorycCstj�|�rdt�|�kSdS)NZsos_logsF��os�path�isdir�listdirr
r
r
rr<sz SoSReportDirectory.check_is_typeN�rrrrrrrrr
r
r
rr4s
rc@s0eZdZdZdZdZdZedd��Zdd�Z	d	S)
�SoSCollectorArchivez�Archive class representing the tarball created by ``sos collect``. It
    will not provide prep files on its own, however it will provide a list
    of SoSReportArchive's which will then be used to prep the parsers
    Zcollectzsos collect tarballTcCs0zt�|�od|kWStk
r*YdSXdS)Nzsos-collectFrr
r
r
rrMsz!SoSCollectorArchive.check_is_typecCs\|jdd�|j}g}t�|�D]6}tj�||�}d|kr t�|�r |�t	||j
��q |S)NT)�quietr)�extractZextracted_pathrrr�joinrr�appendrZtmpdir)�self�_pathZarchives�fnameZarc_namer
r
r�get_nested_archivesTsz'SoSCollectorArchive.get_nested_archivesN)
rrrrrrZ	is_nestedrrr&r
r
r
rrCs
rc@s$eZdZdZdZdZedd��ZdS)�SoSCollectorDirectoryz{The archive class representing the temp directory used by ``sos
    collect`` when ``--clean`` is used during runtime.
    Zcollect_dirzsos collect directorycCs.tj�|�r*t�|�D]}d|krdSqdS)Nzsos-collector-TFr)rrr%r
r
rrgs
z#SoSCollectorDirectory.check_is_typeNrr
r
r
rr'_s
r')Zsos.cleaner.archivesrrrrrrr'r
r
r
r�<module>s"