⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.30
Server IP:
45.79.8.107
Server:
Linux localhost 5.15.0-140-generic #150-Ubuntu SMP Sat Apr 12 06:00:09 UTC 2025 x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.2-1ubuntu2.21
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib
/
python3
/
dist-packages
/
sos
/
__pycache__
/
View File Name :
component.cpython-310.pyc
o idF @ s d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ d dlmZ d dl m Z d dl mZ d dlm Z d dlmZ d dlmZ d d lmZ d d lmZmZ G dd dZG d d dZdS ) N)SUPPRESS)datetime)getpass)rmtree)Path)__version__)TarFileArchive) SoSOptions)TempFileUtil shell_outc @ s e Zd ZdZdZi ZdZdZdZdZ dddddddddd dd dZ dd Zdd Zdd Z dd Zd0ddZdd Zdd Zedd Zdd Zdd Zd d! Zd"d# Zd$d% Zd1d&d'Zd(d) Zd*d+ Zd,d- Zd.d/ ZdS )2SoSComponenta Any sub-command that sos supports needs to subclass SoSComponent in order to be properly supported by the sos binary. This class contains the standardized entrypoint for subcommands, as well as building out supported options from both globally shared option lists, and options supported by that specific subcommand. When sos initializes, it will load an unintialized instance of each class found within one recursion of the module root directory that subclasses SoSComponent. If sos is able to match the user-specified subcommand to one that exists locally, then that SoSComponent is initialized, logging is setup, and a policy is loaded. From there, the component's execute() method takes over. Added in 4.0 unsetTFautoz/etc/sos/sos.confN r )batchcompression_typeconfig_filedebugencryptencrypt_keyencrypt_passquietthreadstmp_dirsysroot verbosityc C s || _ || _|| _d| _d | _d | _d | _d | _zdd l}||j | W n ty0 Y nw | j | j | | _| jr~| }t | _tj|rUt|tjshd| }|d7 }tj| | d || _tjd| jd| _t | j| _| ! | j"r| # | jd ur| j$dt% | j$d d &| j | j$dt'( | j$dd | j$dd | j$dd | j$d| j | j$d| j) | j$d| j*j+ | j,d d S d S )NFr ztemporary directory %s z"does not exist or is not writable zsos.)prefixdirversioncmdline start_timeend_timer run_timecompressiontmpdirtmpdir_fs_typepolicy components)-parserargsr! exit_processarchiver' tempfile_utilmanifestsignalSIGTERMget_exit_handler Exception _arg_defaultsupdatearg_defaultsload_optionsoptsconfigure_loggingget_tmpdir_defaultSoSMetadataospathisdiraccessW_OKsysstderrwrite_exitsys_tmptempfilemkdtempr _setup_loggingload_policyload_local_policy add_fieldr joinr now tmpfstyper) distroadd_section)selfr+ parsed_argscmdline_argsr1 r' msg rV //usr/lib/python3/dist-packages/sos/component.py__init__H sX zSoSComponent.__init__c C s\ zdd l }|jj| jj| jd| _| jj| _W n ty% | d Y nw | j | _ d S )Nr )r probe_runtime)sos.policiespoliciesloadr9 r load_prober) KeyboardInterruptrE is_root_is_root)rR sosrV rV rW rK s zSoSComponent.load_local_policyc C s t N)NotImplementedErrorrR rV rV rW execute s zSoSComponent.executec s fdd}|S )Nc s d _ d S )NT)r- rE )signumframerd rV rW exit_handler s z3SoSComponent.get_exit_handler.
.exit_handlerrV )rR rh rV rd rW r3 s zSoSComponent.get_exit_handlerc C s$ |r| j d | j | t|)Nr )ui_logerror SystemExit)rR rj rU rV rV rW rE s zSoSComponent._exitc C s | j jr tj| j j}ntddpd}tddr.tddr.tjtd|d}tdd|f | _ | j d krGtd t d |S )zIf --tmp-dir is not specified, provide a default location. Normally this is /var/tmp, but if we detect we are in a container, then use a standardized env var to redirect to the host's filesystem instead TMPDIRNz/var/tmpHOST container/z!stat --file-system --format=%s %sz%TtmpfszWARNING: tmp-dir is set to a tmpfs filesystem. This may increase memory pressure and cause instability on low memory systems, or when using --all-logs. )r9 r r= r> abspathgetenvrM lstripr striprO printtimesleep)rR r' rV rV rW r; s zSoSComponent.get_tmpdir_defaultc s6 dd j D }|rt fdd|D S d S )Nc S s g | ] }| d r|qS )list) startswith).0orV rV rW