3
ܓi @ s` d dl Z d dlZd dlmZ G dd deZG dd deZG dd deZG d d
d
eZdS ) N)SoSObfuscationArchivec @ s$ e Zd ZdZdZdZedd ZdS )SoSReportArchivezThis is the class representing an sos report, or in other words the
type the archive the SoS project natively generates
Zreportzsos report archivec C s, yt j|od|kS tk
r& dS X d S )Nz
sosreport-F)tarfile
is_tarfile Exception)clsarc_path r /usr/lib/python3.6/sos.py
check_is_type s zSoSReportArchive.check_is_typeN)__name__
__module____qualname____doc__ type_namedescriptionclassmethodr r r r r
r s r c @ s$ e Zd ZdZdZdZedd ZdS )SoSReportDirectoryzThis 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 directoryc C s t jj|rdt j|kS dS )NZsos_logsF)ospathisdirlistdir)r r r r r
r ) s z SoSReportDirectory.check_is_typeN)r r
r r r r r r r r r r
r ! s r c @ s0 e Zd ZdZdZdZdZedd Zdd Z d S )
SoSCollectorArchivezArchive 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 tarballTc C s, yt j|od|kS tk
r& dS X d S )Nzsos-collectF)r r r )r r r r r
r : s z!SoSCollectorArchive.check_is_typec C sh | j dd | j}g }xLtj|D ]>}tjj||}d|kr"tj|r"|jt || j
| j| j q"W |S )NT)quietz
sosreport-)
extractZextracted_pathr r r joinr r appendr ZtmpdirZkeep_binary_filesZtreat_certificates)self_pathZarchivesfnameZarc_namer r r
get_nested_archivesA s z'SoSCollectorArchive.get_nested_archivesN)
r r
r r r r Z is_nestedr r r r r r r
r 0 s r c @ s$ e Zd ZdZdZdZedd ZdS )SoSCollectorDirectoryz{The archive class representing the temp directory used by ``sos
collect`` when ``--clean`` is used during runtime.
Zcollect_dirzsos collect directoryc C s0 t jj|r,xt j|D ]}d|krdS qW dS )Nzsos-collector-TF)r r r r )r r r r r r
r V s
z#SoSCollectorDirectory.check_is_typeN)r r
r r r r r r r r r r
r! N s r! )r r Zsos.cleaner.archivesr r r r r! r r r r