File: //lib/python3.9/site-packages/sos/report/__pycache__/__init__.cpython-39.pyc
a
G%@iQ@ � @ sV d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlmZ d dlZd dl m
Z
d dl mZ d dl
mZ d dlZd dlmZmZmZmZmZmZmZmZ d dlmZ d dlmZ d d lmZ d dlZd d
l m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z* d dl+m,Z, d dl-m.Z. ej/ej0fZ1ddd�Z2dd� Z3g d�Z4h d�Z5G dd� de�Z6dS )� N)�datetime)�ThreadPoolExecutor)�TimeoutError)�rmtree)�ImporterHelper�SoSTimeoutError�bold�sos_get_command_output�TIMEOUT_DEFAULT�listdir�
is_executable�scrub_url_credential)�_sos)�__version__)�SoSComponent)
�Report�Section�Command�
CopiedFile�CreatedFile�Alert�Note�PlainTextReport�
JSONReport�
HTMLReport)�
SoSCleaner)� SoSUploadF�, c C s� g }| }|rt | �d }nd}|D ]:}t |�t |� t |� dkrP|�|� |}|| | }q"|t |� d � |kr�|d t |� � }|�|� |S )N� � �H )�len�append)Z
first_line�items�indent�sep�lines�line�newline�item� r* �7/usr/lib/python3.9/site-packages/sos/report/__init__.py�_format_list. s
r, c C s t �| 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)r �strptime)�dater* r* r+ �
_format_since@ s r/ )�auto�always�never> Z
HTTP_PROXYZHTTPS_PROXYZNO_PROXYZhttps_proxyZ
http_proxyZ ALL_PROXYc @ s� e Zd ZdZdZdZdddddddddg g g dddg dg dg ddddd dd
g g g ddddddg deeg dddg ddddddddddddddddddd�?Z� fd
d�Ze dd� �Z
e dd� �Zdd� Zdd� Z
dd� Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#d$� Zd�d%d&�Zd'd(� Zd)d*� Zd+d,� Zd-d.� Zd/d0� Zd1d2� Zd3d4� Zd5d6� Zed7d8� �Zd�d9d:�Z d;d<� Z!d=d>� Z"d?d@� Z#dAdB� Z$dCdD� Z%dEdF� Z&d�dHdI�Z'dJdK� Z(dLdM� Z)dNdO� Z*dPdQ� Z+dRdS� Z,dTdU� Z-dVdW� Z.dXdY� Z/dZd[� Z0d\d]� Z1d^d_� Z2d�d`da�Z3dbdc� Z4ddde� Z5dfdg� Z6dhdi� Z7djdk� Z8dldm� Z9dndo� Z:dpdq� Z;drds� Z<dtdu� Z=dvdw� Z>dxdy� Z?dzd{� Z@d|d}� ZAd~d� ZBd�d�� 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 archiveTFr r0 �d N� � /etc/sos/cleaner/default_mapping� obfuscate)?�
alloptions�all_logs�build�case_id�chroot�clean�container_runtime�keep_binary_files�desc�domains�disable_parsers�skip_cleaning_files�dry_run�
estimate_only�experimental�enable_plugins�journal_size�keywords�keyword_file�plugopts�label�list_plugins�list_presets�
list_profiles�log_sizeZlow_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_prefixZ
upload_target�
add_preset�
del_preset�treat_certificatesc s t � �|||� g | _g | _g | _t| _|| _d| _i | _ | �
� | �� | j�
� | _| jj�d�| _| �� d}| jj| _| jjr�d}n| j�� r�| jtjkr�d}| j�d| j� d|� d�� | jjtvr�| j�d | jj� �� t�� | j� � | �!d
� | �"� | �#� | �$� d S )N�/�report�default�cmdline�policyzset sysroot to 'z' (�)zinvalid chroot mode: � )%�super�__init__�loaded_plugins�skipped_plugins�all_options�default_env_vars�env_vars�_args�sysroot�estimated_plugsizes�print_header�
_set_debugrn Zis_rootZ_is_root�manifest�
components�add_section� report_md�_set_directories�optsZin_container�osr% �soslog�debugr<