404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.135.197.167: ~ $
3

�f�;�@s8ddlZddlZddlZddlZddlZddlmZddlZddlZddl	m
Z
mZmZm
Z
mZmZmZddlmZddlZddlmZmZddlZddlmZddlmZddlmZddlZdd	lmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(dd
l)m*Z*ej+ej,fZ-dd
d�Z.dd�Z/dddgZ0Gdd�de�Z1dS)�N)�datetime)�ImporterHelper�SoSTimeoutError�bold�sos_get_command_output�TIMEOUT_DEFAULT�listdir�
is_executable)�rmtree)�ThreadPoolExecutor�TimeoutError)�_sos)�__version__)�SoSComponent)
�Report�Section�Command�
CopiedFile�CreatedFile�Alert�Note�PlainTextReport�
JSONReport�
HTMLReport)�
SoSCleanerF�, cCs�g}|}|rt|�d}nd}xB|D]:}t|�t|�t|�dkrR|j|�|}|||}q$W|t|�d�|kr�|dt|��}|j|�|S)N� ��H)�len�append)Z
first_line�items�indent�sep�lines�line�newline�item�r(�/usr/lib/python3.6/__init__.py�_format_list)s


r*cCstj|d�d�S)z� This function will format --since arg to append 0s if enduser
    didn't. It's used in the _get_parser.
    This will also be a good place to add human readable and relative
    date parsing (like '2 days ago') in the future z<014sz%Y%m%d%H%M%S)rZstrptime)Zdater(r(r)�
_format_since;sr+�auto�alwaysZneverc>s�eZdZdZdZdZdddddddddgggdddgdgdgddddd	dd
gggddddddgdeegdddgddddddddddddddddd�=Z�fdd
�Ze	dd��Z
e	dd��Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd�d$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zed6d7��Zd�d8d9�Z d:d;�Z!d<d=�Z"d>d?�Z#d@dA�Z$dBdC�Z%dDdE�Z&d�dGdH�Z'dIdJ�Z(dKdL�Z)dMdN�Z*dOdP�Z+dQdR�Z,dSdT�Z-dUdV�Z.dWdX�Z/dYdZ�Z0d[d\�Z1d]d^�Z2d�d_d`�Z3dadb�Z4dcdd�Z5dedf�Z6dgdh�Z7didj�Z8dkdl�Z9dmdn�Z:dodp�Z;dqdr�Z<dsdt�Z=dudv�Z>dwdx�Z?dydz�Z@d{d|�ZAd}d~�ZBdd��ZCd�d��ZDd�d��ZEd�d��ZFd�d��ZGd�d��ZH�ZIS)��	SoSReportzaRun a set of commands and file collections and save them to a report for
    future analysis
    z.Collect files and command output in an archiveTFrr,�dN�z /etc/sos/cleaner/default_mapping)=�
alloptions�all_logs�build�case_id�chroot�clean�container_runtime�keep_binary_files�desc�domains�disable_parsers�skip_clean_filesZdry_run�
estimate_only�experimental�enable_plugins�journal_size�keywords�keyword_file�plugopts�label�list_plugins�list_presets�
list_profiles�log_sizeZlow_priority�map_file�
skip_commands�
skip_files�skip_plugins�
namespaces�	no_report�no_env_vars�no_postproc�	no_update�note�only_plugins�preset�plugin_timeout�cmd_timeout�profiles�since�verify�allow_system_changes�	usernames�upload�
upload_urlZupload_directoryZupload_userZupload_passZ
upload_methodZupload_no_ssl_verifyZupload_protocol�upload_s3_endpointZupload_s3_regionZupload_s3_bucketZupload_s3_access_keyZupload_s3_secret_keyZupload_s3_object_prefix�
add_preset�
del_presetcs tt|�j|||�g|_g|_g|_t�|_d|_||_	d|_
i|_|j�|j
�|jj�|_|jjjd�|_|j�d}|jj
|_
|jj
r�d}n|jj�r�|j
tjkr�d}|jjd|j
|f�|jjtk�r|jjd|jj�tj �|j!j"�|j#d�|j$�|j%�|j&�dS)	N�/�report�default�cmdline�policyzset sysroot to '%s' (%s)zinvalid chroot mode: %s�)'�superr.�__init__�loaded_plugins�skipped_plugins�all_options�set�env_vars�archiveZ_args�sysroot�estimated_plugsizes�print_header�
_set_debugreZis_rootZ_is_root�manifestZ
components�add_section�	report_md�_set_directories�optsZin_container�osr#�soslog�debugr5�chroot_modes�error�logging�shutdown�
tempfile_utilr6�_exit�_check_container_runtime�_get_namespaces�_get_hardware_devices)�self�parser�argsrd�msg)�	__class__r(r)rh�s:


zSoSReport.__init__c
Cs�|jdd�}|jddddddd	�|jd
ddddd	�|jd
dddtdd�|jdddddd	�|jddddd�|jddddddd	�|jdddd �|jd!d"tdd#d$d%�|jd&dd'd(�|jd)dd*d(�|jd+dd,dd-d	�|jd.d/d0d1td2gd3�|jd4td5d6d7d8�|jd9d:d;d0d<td=gd3�|jd>d?dd@dAd�|jdBdCddDddEd	�|jdFddGd(�|jdHddIddJd	�|jdKddLtdMdNdO�|jdPdddQdR�|jdSddTd �|jdUdVd0dWtdXgd3�|jdYddZdd[d	�|jd\dd]dd^d	�|jd_dd`ddadb�|jdctdd#ddd%�|jdedfd0dgtdhgd3�|jdidtdjddk�|jdlddmd �|jdnddod �|jdpdqdrd0dstgdtdO�|jdugd0dvdwdx�|jdygd0dzd{dx�|jd|dd}dd~d	�|jddd�dd�d	�|jd�ddd�dR�|jd�dd�d �|jd�dd�d �|jd�dd�d �|jd�dd�d �|jd�ddd�d�gd�d��|jd�ddd�d��|jd�dd�d �|jd�dd�d �|jd�dd�d �|jd�dd�d �|jd�dd�d �|jd�dd�d �|jd�ddd�d�d�d�gd�d��|j�}|jd�tdd�d��|jd�tdd�d��|jd�d��}|jd�d�d�d�ddd�d��|jd�d�gd0d�d��|jd�d0gd�d�d��|jd�d�d0gd�d�d��|jd�d0gd�d�d��|jd�dd�d�dč|jd�ddd�d�d��|jd�d�d�d�d̍|jd�ddd�d�dx�|jd�d�gd0d�d��dS)�NzReport Optionsz.These options control how report collects dataz-az--alloptions�
store_truer1Fz%enable all options for loaded plugins)�action�destrc�helpz
--all-logsr2z-collect all available logs regardless of sizez--sinceZstorerXzbEscapes archived files older than date. This will also affect --all-logs. Format: YYYYMMDD[HHMMSS])r�r�rc�typer�z--buildr3z;preserve the temporary directory and do not package resultsz	--case-idr4zspecify case identifier)r�r�r�z-cz--chrootr5r,zHchroot executed commands to SYSROOT [auto, always, never] (default=auto)z--container-runtimezLDefault container runtime to use for collections. 'auto' for policy control.)rcr�z--descz
--descriptionrzDescription for a new preset)r�r�rcr�z	--dry-runz#Run plugins but do not collect data)r�r�z--estimate-onlyzzApproximate disk space requirements for a real sos run; disables --clean and --collect, sets --threads=1 and --no-postprocz--experimentalr>zenable experimental pluginsz-ez--enable-plugins�extendr?zenable these plugins)r�r�r�r�rcz--journal-sizer/r@z+limit the size of collected journals in MiB)r�rcr�r�z-kz--plugin-optionz
--plugoptsrCz7plugin options in plugname.option=value format (see -l)z--labelz--namerDz"specify an additional report labelz-lz--list-pluginsrEz)list plugins and available plugin optionsz--list-presetsz#display a list of available presetsz--list-profilesrGzBdisplay a list of available profiles and plugins that they includez
--log-sizerHr0z6limit the size of collected logs (not journals) in MiB)r�r�r�rcr�z--low-priorityz(generate report with low system priority)r�rcr�z--namespaceszDlimit number of namespaces to collect output for - 0 means unlimitedz-nz--skip-pluginsrLzdisable these pluginsz--no-reportrNz disable plaintext/HTML reportingz
--no-env-varsrOz$Do not collect environment variablesz
--no-postprocrPzDisable all post-processing)rcr�r�r�z--notezBehaviour notes for new presetz-oz--only-pluginsrSzenable these plugins onlyz--presetzA preset identifier)r�r�r�rcz--plugin-timeoutzset a timeout for all pluginsz
--cmd-timeoutz%set a command timeout for all pluginsz-pz	--profilez
--profilesrWz)enable plugins used by the given profilesz--skip-commandsrJzdo not execute these commands)rcr�r�r�z--skip-filesrKzdo not collect these filesz--verifyrYz+perform data verification during collectionz--allow-system-changesrZzJRun commands even if they can change the system (e.g. load kernel modules)z--uploadz+Upload archive to a policy-default locationz--upload-urlz&Upload the archive to specified serverz--upload-directoryz$Specify upload directory for archivez
--upload-userz'Username to authenticate to server withz
--upload-passz'Password to authenticate to server withz--upload-methodZputZpostz HTTP method to use for uploading)rc�choicesr�z--upload-no-ssl-verifyz'Disable SSL verification for upload url)rcr�r�z--upload-s3-endpointz#Endpoint to upload to for S3 bucketz--upload-s3-regionz!Region to upload to for S3 bucketz--upload-s3-bucketz"Name of the S3 bucket to upload toz--upload-s3-access-keyzAccess key for the S3 bucketz--upload-s3-secret-keyzSecret key for the S3 bucketz--upload-s3-object-prefixzPrefix for the S3 object/keyz--upload-protocolZhttpsZftpZsftpZs3z$Manually specify the upload protocolz--add-presetz#Add a new named command line preset)r�r�r�z--del-presetz$Delete the named command line presetzCleaner/Masking Optionsz7These options control how data obfuscation is performedz--cleanz	--cleanerz--maskr6zObfuscate sensitive information)r�rcr�r�z	--domainsr:z$Additional domain names to obfuscatez--disable-parsersr;zCDisable specific parsers, so that those elements are not obfuscated)r�rcr�r�z--skip-cleaning-filesz--skip-masking-filesr<zBList of files to skip/ignore during cleaning. Globs are supported.z
--keywordsrAzList of keywords to obfuscatez--keyword-filerBz&Provide a file a keywords to obfuscate)rcr�r�z--no-updaterQz%Do not update the default cleaner mapz
--map-filerIz /etc/sos/cleaner/default_mappingz;Provide a previously generated mapping file for obfuscation)r�rcr�z--keep-binary-filesr8zGKeep unprocessable binary files in the archive instead of removing themz--usernamesr[zList of usernames to obfuscate)Zadd_argument_group�add_argumentr+�str�intZadd_mutually_exclusive_group)�clsr�Z
report_grpZ
preset_grpZcleaner_grpr(r(r)�add_parser_options�s\


























zSoSReport.add_parser_optionscCs�|jd�|jd�|jd�|jd�|jdd�}|jd�|jd�|jd	d�}|jd
td�td�f�|jd
td��dddd�}d}x*|D]"}|jd|d�||��dd�q�W|j|�dS)NzSoS Report Detailed Helpz�The report command is the most common use case for SoS, and aims to collect relevant diagnostic and troubleshooting data to assist with issue analysis without actively performing that analysis on the system while it is in use.z�Additionally, sos report archives can be used for ongoing inspection for pre-emptive issue monitoring, such as that done by the Insights project.z�The typical result of an execution of 'sos report' is a tarball that contains troubleshooting command output, copies of config files, and copies of relevant sections of the host filesystem. Root privileges are required for collections.zHow Collections Are Determined)�titlez�SoS report performs it's collections by way of 'plugins' that individually specify what files to copy and what commands to run. Plugins typically map to specific components or software packages.aEPlugins may specify different collections on different distributions, and some plugins may only be for specific distributions. Distributions are represented within SoS by 'policies' and may influence how other SoS commands or options function. For examplepolicies can alter where the --upload option defaults to or functions.zSee Alsoz>For information on available options for report, see %s and %szsos report --helpzman sos-reportz.The following %s sections may be of interest:
zsos helpz'Information on the plugin design of sosz!Information on a specific $pluginz+How sos operates on different distributions)zreport.pluginszreport.plugins.$pluginZpoliciesr�	z<36F)r&)Z	set_titleZadd_textrtr)r��sectionZpsecZssecZ
help_linesZhelpln�lnr(r(r)�display_help�s2

"zSoSReport.display_helpcCstdtdtf��dS)Nz
%s
zsosreport (version %s))�print�_r)r�r(r(r)rq�szSoSReport.print_headercCs.|j�|j�d�|j�|j�|j�d�|_dS)N)�blockZfibre)Zstorage�networkZnamespaced_networkZfstype)�_get_block_devs�_get_fibre_devs�_get_network_devs�_get_network_namespace_devices�_get_devices_by_fstype�devices)r�r(r(r)r��s

zSoSReport._get_hardware_devicescCs�|jjdkr�|jjj�}|dkr6i|j_|jjd�n�|jjsTd|}|jj|�nl||jjj�kr�dj	dd	�|jjj�D��}t
d
||f��n.|jj||jjd<|jjd|jjdj�d
S)a[Check the loaded container runtimes, and the policy default runtime
        (if set), against any requested --container-runtime value. This can be
        useful for systems that have multiple runtimes, such as RHCOS, but do
        not have a clearly defined 'default' (or one that is determined based
        entirely on configuration).
        r,�none�off�diabledz0Disabled all container runtimes per user option.zZWARNING: No container runtimes are active, ignoring option to set default runtime to '%s'
z, css|]}|dkr|VqdS)rcNr()�.0�pr(r(r)�	<genexpr>�sz5SoSReport._check_container_runtime.<locals>.<genexpr>zSCannot use container runtime '%s': no such runtime detected. Available runtimes: %srcz%Set default container runtime to '%s'N)r�r�r�)rwr7�lowerreZruntimesry�info�warning�keys�join�	Exception�name)r�Zcrunr�Zvalidr(r(r)r��s$z"SoSReport._check_container_runtimecCs|yFg}ddddg}x0|D](}tjjd|�r|jtjd|��qW|Stk
rv}z|jjd|�gSd}~XnXdS)	z�Enumerate a list of fibrechannel devices on this system so that
        plugins can iterate over them

        These devices are used by add_device_cmd() in the Plugin class.
        Zfc_hostZfc_transportZfc_remote_portsZ	fc_vportsz
/sys/class/%sz/sys/class/%s/*z#Could not get fibre device list: %sN)rx�path�isdirr��globr�ryr|)r�ZdevsZdevdirsZdevdir�errr(r(r)r��s
zSoSReport._get_fibre_devscs�y�dd�tjd�D�}td�}g�|ddkrbx2|dj�D]"}|j�djdd	�}�j|�q<W�fd
d�|D�}tt|�t|��}|St	k
r�}z|j
jd|�gSd}~XnXdS)
z�Enumerate a list of block devices on this system so that plugins
        can iterate over them

        These devices are used by add_device_cmd() in the Plugin class.
        cSsg|]}d|�qS)z/dev/%sr()r��dr(r(r)�
<listcomp>sz-SoSReport._get_block_devs.<locals>.<listcomp>z
/sys/blockzlosetup --all --noheadings�statusr�output�:rcs"g|]}|jd�r|�kr|�qS)Zloop)�
startswith)r��dev)�real_loop_devicesr(r)r�
s
z#Could not get block device list: %sN)rxrr�
splitlines�split�replacer �listrlr�ryr|)r�Zdevice_listZloop_devicesZloop_devZloop_deviceZghost_loop_devsZdev_listr�r()r�r)r��szSoSReport._get_block_devscCsd|j�i|_dS)Nr�)�_get_network_namespacesrM)r�r(r(r)r�szSoSReport._get_namespacescCs�ggggd�}yPtd|jjd�r.|j|j��|ds\|jjd�|j|j��|j�|d<Wn4t	k
r�}z|jj
d|���WYdd}~XnX|S)	aHelper to encapsulate network devices probed by sos. Rather than
        probing lists of distinct device types like we do for storage, we can
        do some introspection of device enumeration where a single interface
        may have multiple device types. E.G an 'ethernet' device could also be
        a bond, and that is pertinent information for device iteration.

        :returns:   A collection of enumerated devices sorted by device type
        :rtype:     ``dict`` with keys being device types
        )�ethernet�bridgeZteam�bondZnmcli)ror�zZNetwork devices not enumerated by nmcli. Will attempt to manually compile list of devices.r�z%Could not enumerate network devices: N)r	rwro�update�_get_nmcli_devsryrz�
_get_eth_devs�_get_bridge_devsr�r�)r��_devsr�r(r(r)r�s$zSoSReport._get_network_devscCs.i}x$|jdD]}d|j|�i||<qW|S)zqEnumerate the network devices that exist within each network
        namespace that exists on the system
        r�r�)rMr�)r�Z_nmdevsZnmspr(r(r)r�:sz(SoSReport._get_network_namespace_devicescCs�i}y�td�}|ddkrtxX|dj�dd�D]@}|j�\}}||krT|g||<n||j|�|dj|�q0Wtt|d��|d<Wn2tk
r�}z|jjd|�WYdd}~XnX|S)	z�Use nmcli, if available, to enumerate network devices. From this
        output, manually grok together lists of devices.
        znmcli --fields DEVICE,TYPE devr�rr�rfNr�z!Could not parse nmcli devices: %s)	rr�r�r r�rlr�ryrz)r�r�Z_ndevsr�ZdnameZdtyper�r(r(r)r�Es"zSoSReport._get_nmcli_devscsdg�g}|sby�fdd�tdd�D�}Wq�tk
r^}z|jjd|���WYdd}~Xq�Xn�yHd|}t|�}|dd	kr�x&|d
j�D]}|�kr�|j|�q�WWn6tk
r�}z|jjd||f�WYdd}~XnX|dd�|D�d
d�|D�d�S)a8Enumerate a list of ethernet network devices so that plugins can
        reliably iterate over the same set of devices without doing piecemeal
        discovery.

        These devices are used by `add_device_cmd()` when `devices` includes
        "ethernet" or "network".

        :param namespace:   Inspect this existing network namespace, if
                            provided
        :type namespace:    ``str``

        :returns:   All valid ethernet devices found, potentially within a
                    given namespace
        :rtype:     ``list``
        Zbonding_masterscsg|]}|�kr|�qSr(r()r�r�)�	filt_devsr(r)r�qsz+SoSReport._get_eth_devs.<locals>.<listcomp>z/sys/class/netNz.Failed to manually determine network devices: z"ip netns exec %s ls /sys/class/netr�rr�z6Could not determine network namespace '%s' devices: %scSsg|]}|jd�r|�qS)r�)r�)r�Zbdr(r(r)r��scSsg|]}|jd�r|�qS)�tun)r�)r�Ztdr(r(r)r��s)r�r�r�)rr�ryr�rr�r )r��	namespaceZ	_eth_devsr�Z_nscmdZ_nsoutZ_nsethr()r�r)r�Ys, zSoSReport._get_eth_devscCs�g}ytddd�}Wn2tk
rF}z|jjd|�WYdd}~XnX|ddkr�xj|dj�d	d�D]R}y|j|j�d�Wqjtk
r�}z|jjd
||f�WYdd}~XqjXqjW|S)z�Enumerate a list of bridge devices so that plugins can reliably
        iterate over the same set of bridges.

        These devices are used by `add_device_cmd()` when `devices` includes
        "bridge" or "network".
        z
brctl show�)�timeoutz&Unable to enumerate bridge devices: %sNr�rr�rfz)Could not parse device from line '%s': %s)rr�ryr�r�r r�r�)r�Z_bridgesZ_boutr�Z_bliner(r(r)r��s""zSoSReport._get_bridge_devscCs`g}td�}|ddkr\xB|dj�D]2}|j�s&|dd�j�rDq&|j|jd�d�q&W|S)z�Enumerate a list of network namespaces on this system so that
        plugins can iterate over them

        Note that stderr is not collected, so no handling of error lines.
        zip netnsr�rr�Nrfr)rr��isspacer �	partition)r�Zout_nsZip_netnsr%r(r(r)r��sz!SoSReport._get_network_namespacescCs�i}td�}|ddkr|Sxr|dj�D]b}|j�j�}t|�dkrR|jdd�d|dkrfd|d<|j|dg�||dj|d�q*W|S)	Nzlsblk -snrpo FSTYPE,NAMEr�rr�rf�unknown�extZext4)rr��stripr�r�insert�
setdefaultr )r�Z_dev_fstypesr�r%�helperr(r(r)r��sz SoSReport._get_devices_by_fstypecCs4|j|j|j|j|j|j|j|jj|j|j	|j
d�S)N)�cmddir�logdir�rptdir�tmpdirryrero�	verbosityZcmdlineoptsr�rM)r�r�r�r�ryrerorwr�r�rM)r�r(r(r)�get_commons�szSoSReport.get_commonscCs
|jj�S)N)r�new)r�r(r(r)�
get_temp_file�szSoSReport.get_temp_filecCs4|jj|jd�|jj|jd�|jj|jd�dS)Ni�)rn�makedirsr�r�r�)r�r(r(r)�_make_archive_paths�szSoSReport._make_archive_pathscCsd|_d|_d|_dS)NZsos_commands�sos_logs�sos_reports)r�r�r�)r�r(r(r)rv�szSoSReport._set_directoriescCs"|jjr|jt_d|_nd|_dS)NTF)rwrz�
_exception�sys�
excepthook�
raise_plugins)r�r(r(r)rr�szSoSReport._set_debugcCsNttd�stjj�r&tj|||�n$tj|||dtjd�t�t	j
�dS)z* Wrap exception in debugger if not in tty Zps1�)�limit�fileN)�hasattrr��stderr�isatty�__excepthook__�	traceback�print_exception�stdoutr��pdbZpm)�etypeZeval_Zetracer(r(r)r��s
zSoSReport._exceptioncCsV|js|jr>tj�\}}}tj|||tjd�t�tj	|�|rR|rR|j
||�dS)N)r�)r�Zexit_processr��exc_infor�r�r�r�r�Zpost_mortem�_log_plugin_exception)r��plugname�funcr��val�tbr(r(r)�handle_exception�s
zSoSReport.handle_exceptioncCsTt|dd�r(|jj|jtjjdd�d�t|dd�rP|jj|jtjjdd�d�dS)N�sos_log_filer�zsos.log)r��sos_ui_log_filezui.log)�getattrrn�add_filer�rxr�r�r�)r�r(r(r)�
_add_sos_logs�s

zSoSReport._add_sos_logscsV�jj}t�jj�sdSt|d�s&dS|r>�j|j��r>dSt�fdd�|jD��S)NTrWFcsg|]}|�jjk�qSr()rwrW)r�r�)r�r(r)r�sz,SoSReport._is_in_profile.<locals>.<listcomp>)rwrSrrWr��_is_not_specifiedr��any)r��plugin_classrSr()r�r)�_is_in_profiles
zSoSReport._is_in_profilecCs||jjkS)N)rwrL)r��plugin_namer(r(r)�_is_skippedszSoSReport._is_skippedcCs*||j��j�o(||jjko(||jjkS)N)r�Z
check_enabledrwr?rS)r�r�pluginClassr(r(r)�_is_inactiveszSoSReport._is_inactivecCs*||j��j�o(||jjko(||jjkS)N)r�Zdefault_enabledrwr?rS)r�rrr(r(r)�_is_not_defaultszSoSReport._is_not_defaultcCs|jjo||jjkS)N)rwrS)r�rr(r(r)r�"szSoSReport._is_not_specifiedr�cCs"|jj|j�||j��|f�dS)N)rjr r�r�)r�r�reasonr(r(r)�_skip&s
zSoSReport._skipcCs |jj|j�||j��f�dS)N)rir r�r�)r�rr(r(r)�_load-szSoSReport._loadcCs�tjjj}ttjj�}|j�}g|_t�|_t	|j
j�}|jj}g}|j
j
r\|jtjjj�t||�}|jj}t|j
j�}	�x�|D�]�}
tjj|
�\}}�yp|||�}
t	|
�s�w�|jj|
�}|||j
j
d��s|jjtd�|
�|j
jdk�r|j|td��w�|jj|�|j|�}|�s2|j|td��w�|j|��rP|j|td��w�|j||��rp|j|td��w�|j||��r�|j|td��w�t |d	��r�|jj!|j�|�o�|}|j"|��r�|�r�|j|td
��w�x$|jD]}||	k�r�|	j#|��q�W|j$|�Wq�t%k
�rP}z&|jjtd�|
|f�|j&�WYdd}~Xq�Xq�Wt	|	�dk�r�|jj'td�d
j(|	��|j)�|j*d�dS)N)r>z%plugin %s does not validate, skippingrzdoes not validateZexcludedZskippedZinactiveZoptionalrWz
not specifiedz(plugin %s does not install, skipping: %sz+Unknown or inactive profile(s) provided: %sz, rf)+�sosrb�plugins�
import_pluginrZget_modules�plugin_namesrlrWrrwreZvalid_subclassesr>r ZExperimentalPlugin�tuple�validate_pluginr�rxr��splitextZmatch_pluginryr�r�r�r	rrrrr�r�r��remover
r�r�r|r�rGr�)r�r
r�rZusing_profilesZpolicy_classesZ
extra_classesZvalid_plugin_classesrZremaining_profiles�plugZplugbaser�Zplugin_classesrZ
in_profileZdefault_profile�i�er(r(r)�load_plugins3sx



zSoSReport.load_pluginscCsD|jjr@x6|jD],\}}x"|jj�D]}t|jkr$d|_q$WqWdS)NT)rwr1ri�options�values�boolZval_type�value)r�r�r�optr(r(r)�_set_all_options�s

zSoSReport._set_all_optionsc$Cs|jj�ri}�x�|jjD]�}y|jd�\}}Wntk
rHd}YnXt|t�r�|j�}|dkrjd}n0|dkrxd
}n"yt|�}Wntk
r�YnXy|jd�\}}Wntk
r�|}d}YnXy||Wntk
�r�i||<YnX||||<qWx�|j	D]�\}}||k�rx�||D]�}||j
k�rX|jjd||f�|j
d�y6|j
|j|||�|jjd||j
|f�Wn:tk
�r�}z|jj|�|j
d�WYdd}~XnX�q*W||=�qWx"|j�D]}|jjd|��q�W|j��r|jjd�dS)N�=T�on�enable�enabled�true�yesr��disable�disabled�false�noF�.z#no such option "%s" for plugin (%s)rfzSet %s plugin option to %szGWARNING: unable to set option for disabled or non-existing plugin (%s).r)rrr r!r")r�r#r$r%r&)rwrCr��
ValueError�
isinstancer�r�r��KeyErrorrirryr|r�Z	set_valuerzr�r�)r�rwrr�rr�r�r(r(r)�
_set_tunables�s`





"
zSoSReport._set_tunablescCs�ddl}xN|j|jj|jj�D]6}|jd�d}||jkr|jjd|�|j	d�qWx*|jj
D]}||jkrb|jjd|�qbWdS)Nrr'z=a non-existing plugin (%s) was specified in the command line.rfz+Requested to skip non-existing plugin '%s'.)�	itertools�chainrwrSr?r�rry�fatalr�rLr�)r�r,�pluginrr(r(r)�_check_for_unknown_plugins�s

z$SoSReport._check_for_unknown_pluginscCs:x4|jD]*\}}x |jD]}|jj|j|�qWqWdS)N)rirrkr )r�rr/rr(r(r)�_set_plugin_options�szSoSReport._set_plugin_optionscCs�d}g}|jjdkr.|d|jjg7}d|j_|jjsH|dg7}d|j_|jjsb|dg7}d|j_|jjr||dg7}d|j_|jjr�|d	g7}d|j_|r�|d
dj|�7}n|d7}|d
7}|S)Nz
Estimate-only mode enabledrfz--threads=%s overriden to 1z--build enabledTz--no-postproc enabledz--clean disabledFz--upload* options disabledz", which overrides some options:
  z
  r'z

)rw�threadsr3rPr6r\r�)r�r�Zext_msgr(r(r)�_set_estimate_only�s,



zSoSReport._set_estimate_onlycCs^|jjd�t|j�r8|jjdt|j�t|j�f�n|jjdt|j��|jjd�dS)Nrz %d profiles, %d pluginsz %d profiles)�ui_logr�rrirW)r�r(r(r)�_report_profiles_and_plugins�s
z&SoSReport._report_profiles_and_pluginsc
Cs�|jr$|jr$|jjtd��dS|jrt|jjtd��|jjd�x<|jD] \}}|jjd||j�f�qNWn|jjtd��|jjd�|jr�|jjtd��|jjd�x.|jD]$\}}}|jjd|||j�f�q�W|jjd�|j�rV|jjtd��|jd	d
j	�}x�|D]�}||}|j
}|j
dk�rt|dk�rV|jj�pRt
}n|dk�rp|jj�plt
}nt
}|jd
k�r�|jj}|jjd|j||jf��qW|jjd�|jjtd��x�|jD]�}|jdk�r�|j
|jk�r�q�t|j
t��r|j
dk�rd}	nd}	n|j
}	|	dk�r*d	}	|jjd|jd|j|	|jf��q�Wn|jjtd��|jjd�t|j�}
|
j�td|
dd�}x|D]}|jjd|��q�W|j�dS)Nzno valid plugins foundz,The following plugins are currently enabled:rz	 %-20s %szNo plugin enabled.z-The following plugins are currently disabled:z %-20s %-14s %sz4The following options are available for ALL plugins:rrfr��cmd-timeout�postprocz %-25s %-15s %sz+The following plugin options are available:Trr�r'zNo plugin options available.z
Profiles: )r"z %s���)r�r7r6)rirjryr.r�r4r�Zget_descriptionrkZget_default_plugin_optsrrwrUrrVr�rPr9rcr)rr/r�rW�sortr*r5)
r�r�rZ	plugclassrZ	_defaultsZ_optrr�ZtmpoptrWr$r%r(r(r)rE�st




 
$

zSoSReport.list_pluginsc	Cs�|js|jjtd��dS|jjtd��|jjd�dd�}t|j�}|j�xp|D]h}g}x.|jD]$\}}||�rf||jkrf|j	|�qfWt
d||dd�}x|D]}|jjd	|�q�WqVW|j�dS)
Nzno valid profiles foundz%The following profiles are available:rcSs
t|d�S)NrW)r�)�cr(r(r)�	_has_profPsz*SoSReport.list_profiles.<locals>._has_profz%-15s T)r"z %s)rWryr.r�r4r�r�r9rir r*r5)	r�r;rWZprofilerr�r/r$r%r(r(r)rGIs"


zSoSReport.list_profilescCs|jjs|jjtd��dS|jjtd��|jjd�x�|jjj�D]�}|sPqF|jj|�}|jjdd|j	f�|jjdd|j
f�|jr�|jjdd|jf�|jj
dkr�|jj�}d	d
}t||ddd
�}x|D]}|jj|�q�W|jjd�qFWdS)Nzno valid presets foundz$The following presets are available:rz%14s %szname:zdescription:znote:rz%14s zoptions:Tr)r"r#)reZpresetsryr.r�r4r�r��find_presetr�r9rRrwr��to_argsr*)r�rTr�Zoptions_strr$r%r(r(r)rF_s(

zSoSReport.list_presetscCs�|j}|j|�r$|jjd|�dS|p.|jj}|p:|jj}y|j||||jd�Wn0tk
r�}z|jjd|�dSd}~XnX|j	j
d�}|j	d|�|j	|dd�}|jjd	|d
j|�f�dS)z�Add a new command line preset for the current options with the
            specified name.

            :param name: the name of the new preset
            :returns: True on success or False otherwise
        z"A preset named '%s' already existsF)r�r9rRrwzCould not add preset: %sNz--add-presetrr�z"Added preset '%s' with options %s
rT)
rer<r4r|rwr9rRr_r�rd�indexr�r�)r�r�r9rRrerZ	arg_indexr�r(r(r)r_ws 
 zSoSReport.add_presetcCs~|j}|j|�s$|jjd|�dSy|j|d�Wn4tk
rh}z|jjt|�d�dSd}~XnX|jjd|�dS)z�Delete a named command line preset.

            :param name: the name of the preset to delete
            :returns: True on success or False otherwise
        zPreset '%s' not foundF)r��
NzDeleted preset '%s'
T)rer<r4r|r`r�r�r�)r�r�rerr(r(r)r`�s
zSoSReport.del_presetcCs�|jj�}|jjr||j�7}|jjr4|jj|�np|td�7}yt	|�WnVt
k
rv|jjd�|jd�Yn.t
k
r�}z|jd|�WYdd}~XnXdS)Nz,Press ENTER to continue, or CTRL-C to quit.
zExiting on user cancel�rf)reZget_msgrwr=r3�batchr4r�r��input�KeyboardInterruptr|r�r�)r�r�rr(r(r)rA�s
zSoSReport.batchcCsdtj�}d}d|}tjj|j|�}|jjd|||f�|jjd|�|jj	d||dd�dS)Nz!caught exception in plugin methodz%s-plugin-errors.txtz%s "%s.%s()"zwriting traceback to %sz%s
�a)�mode)
r��
format_excrxr�r�r�ryr|rn�
add_string)r�r/�methodZtracer�Zplugin_err_logZlogpathr(r(r)r��szSoSReport._log_plugin_exceptioncCs�|jj�y$|jjtd��|j�|j�dSttfk
r�}z>|j	t
krntd�td|j�td�ntd|��WYdd}~XnNt
k
r�}z2|jjd�|jjd�tj�|jj|�WYdd}~XnX|jd�dS)Nz Setting up archive ...rz %s while setting up archivezError setting up archive: %sz) Unexpected exception setting up archive:rf)reZpre_workr4r�r�Z
setup_archiver��OSError�IOError�errno�fatal_fs_errorsr��strerrorr�r|r��	print_excr�)r�rr(r(r)�prework�s&


zSoSReport.preworkcCsp|jjtd���xX|jD�]L\}}y�|jjj|�|jt|jj|��t	j
�}|jjd|�|j
|_
|j�|j�|jj|j�|jjr�|j�t	j
�}|jjd|�|jjd||�Wqtk
r��Yqttfk
�rF}zR|jtk�r*|jjd�|jjd|j�|jjd�|jd�|j|d�WYdd}~Xqtk
�rf|j|d�YqXqWdS)	Nz Setting up plugins ...Zsetup_startZ	setup_endZ
setup_timerz %s while setting up pluginsrf�setup) r4r�r�rirurrtZset_plugin_manifestr�r�nowrs�	add_fieldrnZadd_default_collectionsrPrmr�Z	_env_varsrwrYZsetup_verifyrCrIrJrKrLr|rMr�r�r�)r�r�r�start�endrr(r(r)rP�s:

zSoSReport.setupcCs,g}|jdt�|jjdj|�dd�dS)zWFetch version information from all plugins and store in the report
        version filez
sosreport: %sr?zversion.txt)�contentr�N)r rrnrGr�)r�Zversionsr(r(r)�version�szSoSReport.versioncCs�|jjtd��|jjd�d}g|_g|_x*|jD] }|d7}|jj||df�q4Wybg}t|jj	��}|j
|jt|j��}WdQRXx |D]}|s�|j
jd|�q�W|jjd�Wn*tk
r�|jjd�tjd�YnXdS)Nz! Running plugins. Please wait ...rrrfz!Unexpected plugin task result: %sz
Exiting on user cancel
)r4r�r��pluglist�
running_plugsrir rrwr2�map�_collect_pluginr�ryrzrCr|rxr�)r�Zplugruncountr�results�executor�resr(r(r)�collects*
zSoSReport.collectcCs�td���}y||j|ddd}|j|j|�}|jp:d}tj�}|jjd|�|j	|d�tj�}|jjd|�|jjd||�Wn~t
k
�rd|d}|jjd	|�|j
j|�|jj|d�|j|dddj�|jd
d�|jj�YnXWdQRX|jj�r�|jj�}	y.td|	�}
t|
d
j�d�|j|d<Wn$tk
�rxd|j|d<YnXxTtj|	�D]F}tj j!|	|�}tj j"|��r�tj j#|��r�t$|�n
tj%|��q�Wd
S)zaWraps the collect_plugin() method so we can apply a timeout
        against the plugin as a wholerfrNZ
start_time)r�Zend_timeZrun_timezPlugin %s timed outz
 %s
T)�waitz
du -sB1 %sr�)&rriZsubmit�collect_pluginr�rrQrsrR�resultrr4r|ryr�rXrZset_timeout_hitr~Z_threads�clearrwr=rnZget_tmp_dirrr�r�rpr�rxrr�r�r��islinkr
�unlink)r�r/ZpoolZ_plug�tr�rSrTr�r�Zdu�fr(r(r)rZs@


"
zSoSReport._collect_pluginc	$Csy*|\}}|j|dd}|jj|�Wntk
r>dSXt|j�}dd||f|ddjdd�|jD��f}|j|�y�|j�y|jj	|�Wn(t
k
r�|jjd	|�d
��YnXy|jj	|�Wn*t
k
�r�|jjd	|�d��YnXd}t|j�t
|jj�k�rF|j�rFd
dddjdd�|jD��f}|j�r^|j�r^d}|�rn|j|�Wn�tk
�r�Yn�ttfk
�r�}zL|jtk�r�|jjd|j�|jjd|j�tjd�|j|d�WYdd}~Xn"tk
�r|j|d�YnXdS)NrfFz  Starting %-5s %-15s %sz%d/%dz
[Running: %s]rcss|]
}|VqdS)Nr()r�r�r(r(r)r�Xsz+SoSReport.collect_plugin.<locals>.<genexpr>zCould not remove z from plugin list, ignoring...z& from running plugin list, ignoring...rz  Finishing plugins %-12s %scss|]
}|VqdS)Nr()r�r�r(r(r)r�rsz
  Finished running pluginsz!
 %s while collecting plugin dataz& Data collected still available at %s
r^)rirXr r�rr��ui_progressr`rWrr(ryrzr�rwr2rrIrJrKrLr4r|rMr�rxr�r�)	r�r/�countr�rZnumplugs�status_liner�rr(r(r)r`Ms^





zSoSReport.collect_plugincCsP|jjdkr&|jjr&d|jd�}nd|}|jjsLtjj|�tjj�dS)Nrz
%s�Zz%s
)	rwr�rA�ljust�quietr�r��write�flush)r�rir(r(r)rg�szSoSReport.ui_progresscCs@|js
dSdjdd�dd�|jD�D��d}|jj|d�dS)Nr?cSsg|]\}}d||f�qS)z%s=%sr()r�r�r�r(r(r)r��sz.SoSReport.collect_env_vars.<locals>.<listcomp>cSs0g|](}tjj|�dk	r|dtjj|�f�qS)Nz%s)rx�environ�get)r�r�r(r(r)r��sZenvironment)rmr�rnrG)r��envr(r(r)�collect_env_vars�szSoSReport.collect_env_varscCs�t�}x�|jD]�\}}t|d�}x|jD]}|jt|��q(W|jrT|jt|j��x,|jD]"}|jt	|dd|dd��q\Wx>|j
D]4}|jt|ddtj
jd|j�d|d	�d
��q�Wx0|jD]&\}}}	|jt|tj
jd|�d��q�W|j|�qWtddftd
dftddff}
x�|
D]�\}}}
yT|j�}||�j�}|jdd�j�}|j|�|j�|jj|tj
jd|�d�Wnlttfk
�r�}zJ|jt k�r�|j!j"d�|j!j"d|j#|
f�|j!j"d�|j$d�WYdd}~XnX�q$WdS)N)r�Zsrcpathz..Zdstpath)r��href�cmdrr�r�)r�Zreturn_coderszsos.txt�textzsos.jsonZJSONzsos.htmlZHTMLzutf-8r�r�)r�rz %s while writing %s reportrf)%rrirZalerts�addrZcustom_textrZcopied_filesrZexecuted_commandsrrxr�r�r�Zcopy_stringsrrrrr�Zunicode�encode�decodermrnrnr�rIrJrKrLr4r|rMr�)r�rbr�rr�ZalertrfrtrU�tagsZ
formatlistZclass_�filenameZtype_�fdr�rr(r(r)�generate_reports�sN


zSoSReport.generate_reportscCs�x�|jD]�\}}y(|jd�r&|j�n|jjd|�Wqttfk
r�}zP|jtkr�|j	j
d�|j	j
d|j�|j	j
d�|jd�|j
|d�WYdd}~Xqtk
r�|j
|d�YqXqWdS)Nr7zSkipping postproc for plugin %srz% %s while post-processing plugin datarf)riZ
get_optionr7ryr�rIrJrKrLr4r|rMr�r�r�)r�r�rrr(r(r)r7�s 




zSoSReport.postproccCsr|sdSyDd}t|d�}tj|�}x|j|�}|s4P|j|�q$W|j�Wntk
rh|j�YnX|j�S)NFir��rbi)	�open�hashlibr��readr��closer�r�Z	hexdigest)r�rn�	hash_nameZ	hash_sizeZ
archive_fpZdigestZhashdatar(r(r)�_create_checksum�s


zSoSReport._create_checksumcCs0t|d|d�}|r$|j|d�|j�dS)Nr'�wr?)r~rmr�)r�rnr��checksum�fpr(r(r)�_write_checksum�szSoSReport._write_checksumcRsd}d}d}|j�d}|jjr�yJ|j|j|j|j|jd�}td|d�}|j|j	j
��|j�\}}d}Wn2tk
r�}zt
td|��WYdd}~XnX|j�|jdk	r�|j	j|jj�|j�|�r0tjj|j|j	j�}	|jtjj|	dd�dd�|jtjj|	dd	�d	d�|jtjj|	d
d�dd�|jj�rB|j�|jj�r&dd
lm�ddlm}
|
|j�}tdd�|j d�D��|j!d<�t|j!j"���}|j#j$d|�t%|j!j&�dd�dd�dd�}
dj�fdd�|
D��}|j#j$d|�|j#j$d�|j#j$d�|j#j$d�|j#j$d�|jj'�stj(d�}|jj�sPt
td ��z�y&|�rf|j	j)|�|j	j*|jj�}Wn�t+t,fk
�r�}zHt
d�t
td!|j-|j	j
�f��t
d�|j.t/k�r�|j0d"�WYdd}~Xn(tk
�r|jj1�r�ndSYnXWdtj(|�Xn�|jj2�s0|jj3�r<|j#j4d#�|j	j
�}tjj5|�}|�rb|j6|�}y$tjj|j|�}tj7||�|}Wn*t+t,fk
�r�t
td$|��dSXd}|jj'�s8|�s�t
d%��qLy|jj8�}|j9||�}Wn"tk
�rt
td&��dSXy|j:|||�Wn*t+t,fk
�rLt
td'|��YnXtjj5|�}|�rr|j6|j;d(d)��}tjj|j|�}tj<|�}|d*|}|d*|}ytj7||�|}Wn*t+t,fk
�r�t
td+|��dSXytj7||�Wn*t+t,fk
�rt
td,|��YnX|jj=|||||d-�n|jj=||||d-�|jj>�sj|jj?�sj|jj@�r�|jj'�s�y |jjA|�|j#j$td.��Wn4tk
�r�}z|j#jBd/|�WYdd}~XnXnd0}|j#jB|�tCjD�|jE�r�|jEj�|j�rtjjF|j��rtG|j�dS)1NF)rer��sys_tmprrsT)Zin_place�hook_commonsz%ERROR: Unable to obfuscate report: %sr�zsos.log)Z
short_namezui.logr�z
manifest.jsonr)�get_human_readable)�PathcSsg|]}|j�j�qSr()�lstat�st_size)r�rfr(r(r)r�9sz(SoSReport.final_work.<locals>.<listcomp>z**/*Zsos_logs_reportszPEstimated disk space requirement for whole uncompressed sos report directory: %scSs|dS)Nrfr()�xr(r(r)�<lambda>?sz&SoSReport.final_work.<locals>.<lambda>)�key�reverse�z,  c3s&|]\}}d|�|dd�fVqdS)z%s: %sr)Z	precisionNr()r�r��v)r�r(r)r�@sz'SoSReport.final_work.<locals>.<genexpr>zFive biggest plugins:  %srz>Please note the estimation is relevant to the current options.z�Be aware that the real disk space requirements might be different. A rule of thumb is to reserve at least double the estimation.�?zCreating compressed archive...z %s while finalizing archive %srfzQ
Unable to encrypt when using --build. Encryption is only available for archives.zError moving directory: %sz Creating archive tarball failed.z:Error generating archive checksum after archive creation.
z#Error writing checksum for file: %sz.tarz-obfuscated.tarr'zError moving archive file: %szError moving checksum file: %s)rIzUploaded archive successfullyzUpload attempt failed: %szEUnable to upload archive when using --build as no archive is created.)H�generate_manifest_tag_summaryrwr6rer�r�rsrZset_target_pathrnZget_archive_path�executer�r�r�r�Zadd_final_manifest_dataZcompression_typeZ_obfuscate_upload_passwordsrxr�r��_nameZobfuscate_filerlZadd_ui_log_to_stdoutr=�
sos.utilitiesr�Zpathlibr��sumr�rprr4r��sortedr!r3�umaskZrename_archive_root�finalizerIrJrMrKrLr�rzZencrypt_passZencrypt_keyr��basenameZobfuscate_string�renameZget_preferred_hash_namer�r�r��statZdisplay_resultsr\r]r^Zupload_archiver|r}r~rr�r
)r�rnZ	directoryrIZdo_cleanr�ZcleanerZ_pathsr�Z_dirr�Ztmpdir_pathZ_sumZ
bigpluginsZbp_outZ	old_umaskrZdir_nameZ	final_dirr�r�Zbase_archiveZ
final_nameZarchivestatZarchive_hashZ
final_hashr�r()r�r)�
final_work�s
"
















$

zSoSReport.final_workcCs|js|jjtd��dSdS)Nzno valid plugins were enabledFT)riryr|r�)r�r(r(r)�verify_plugins�szSoSReport.verify_pluginscCs|jjd|j�|jjd|jr&|jjnd�|jjd|jj�d}td�r~t	dt
j����}|dd	kr~|d
j�d	j
d�}|jjd�|jjjd
|�|jjjdt
jd	��|jjd�x&|jj�D]\}}|jjj||�q�W|jjd|jj�|jjd|jj�|jjd�dS)zgAdd 'global' data to the manifest, that is any information that is
        not plugin-specific
        rorTZunsetrWr�Zionicez
ionice -p r�rr�r��priorityZio_classZnicenessr�Zenabled_pluginsZdisabled_pluginsrN)rurRrorTr�Zadd_listrwrWr	rrx�getpidr�r�rtr��nicer�r!r?rL)r�Z	_io_class�_ior�rr(r(r)�add_manifest_data�s$zSoSReport.add_manifest_datacs�d�fdd�	}i�xZ|jjD]N}x|jD]}||�q(Wx|jD]}||d�q@Wx|jD]}||�qZWqW|jjdtt�j����dS)acAdd a section to the manifest that contains a dict summarizing the
        tags that were created and assigned during this report's creation.

        This summary dict can be used for easier inspection of tagged items by
        inspection/analyzer projects such as Red Hat Insights. The format of
        this dict is `{tag_name: [file_list]}`.
        �filepathc
s�x�|dD]v}||s
|r q
y�|}Wntk
rDg}YnX|jt||t�r`||n||g�ttt|����|<q
WdS)Nry)r*r�r)r�r�rl)Zentr��tagr�)�tag_summaryr(r)�compile_tags�s
"z=SoSReport.generate_manifest_tag_summary.<locals>.compile_tagsZfiles_copiedr�N)r�)	rurZcommands�files�collectionsrR�dictr�r!)r�r�rrtZ_fileZ
collectionr()r�r)r��s
z'SoSReport.generate_manifest_tag_summarycCszd}|jj|tddj|j�f�|jjj�}dtd|jjdj|�f}|jj|�|jjdtddj|jj��f�dS)Nz[%s:%s] executing 'sos %s'rPrz'[%s:%s] using '%s' preset defaults (%s)z![%s:%s] effective options now: %s)	ryr��__name__r�rdrTrwr=r�)r�r�Zpreset_argsr(r(r)�_merge_preset_optionsszSoSReport._merge_preset_optionscCs��y6|jj|j��|j�|j�|j�|j�|j�|j�|j	j
rX|j
�t�|j	jrl|j�t�|j	j
r�|j
�t�|j	jr�|j|j	j�t�|j	jr�|j|j	j�t�|j�s�t�|j�|j�|j�|j�|j�|j	js�|j�|j	j�s
|j�|j	j�s|j�n|jjd�|j�|j�St k
�rt|j	j!�rV�t"j#dd�dk�sp|j$�Yn|t%k
�r�|jj&d�|j$�|j'd�YnJtk
�r�}z,t"j#dd�dk�s�|j$�t(j)|j*�WYdd}~XnX|j'd�dS)Nz)Skipping postprocessing of collected dataZ
SOS_TEST_LOGSZkeepz
Exiting on user cancelr@rf)+reZset_commonsr�rrr�r+r0r1rwrE�
SystemExitrGrFr_r`r�rArOr�rPr^rOrrrNr|rPr7r4r�rVr�rIrzrx�getenvZcleanuprCr|r�r��exit�code)r�rr(r(r)r�sj



zSoSReport.execute)N)NN)r�)rr)Jr��
__module__�__qualname__�__doc__r9Z
root_requiredrZarg_defaultsrh�classmethodr�r�rqr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rvrr�staticmethodr�r�r�rrrrr�r	r
rrr+r0r1r3r5rErGrFr_r`rAr�rOrPrVr^rZr`rgrrr|r7r�r�r�r�r�r�r�r��
__classcell__r(r()r�r)r.Gs(O7
2


O<
K
	
1;	
7R r.)Fr)2r�r�rxrKr}rr�Zsos.report.pluginsrr�rrrrrrr	Zshutilr
r�concurrent.futuresrrr�r
r�rZ
sos.componentrZsos.policiesZsos.report.reportingrrrrrrrrrrZsos.cleanerrZENOSPCZEROFSrLr*r+r{r.r(r(r(r)�<module>s.$0
	


Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 50.76 KB 0644
__init__.cpython-36.pyc File 50.76 KB 0644
reporting.cpython-36.opt-1.pyc File 8.06 KB 0644
reporting.cpython-36.pyc File 8.06 KB 0644