NineSec Team Shell
Server IP : 184.107.3.203  /  Your IP : 216.73.216.51
Web Server : Apache
System : Linux dedicated2.avenfashion.com.ph 4.18.0-553.40.1.el8_10.x86_64 #1 SMP Mon Feb 10 12:11:18 EST 2025 x86_64
User : adminteladeoro ( 1015)
PHP Version : 8.2.28
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/lib/python3.6/site-packages/sos/help/__pycache__/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/lib/python3.6/site-packages/sos/help/__pycache__/__init__.cpython-36.pyc
3

~�gk+�@s�ddlZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZmZyeej�jd�ZWnek
r�dZYnXGd	d
�d
e	�ZGdd�d�ZdS)
�N)�OrderedDict)�fill)�SoSComponent)�
import_policy)�Plugin)�bold�ImporterHelper�xcs�eZdZdZdZdZdZdZddiZ�fdd�Z	e
dd	��Zd
d�Zdd
�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Z�ZS)�	SoSHelperz�Provide better, more in-depth help for specific parts of sos than is
    provided in either standard --help output or in manpages.
    zDetailed help infomationF�topic�cst�j|||�|jj|_dS)N)�super�__init__�optsr)�self�parser�argsZcmdline)�	__class__��/usr/lib/python3.6/__init__.pyr+szSoSHelper.__init__cCs*d|_|jdd�}|jdddddd	�dS)
Nzsos help TOPIC [options]zHelp Information Optionsz<These options control what detailed information is displayedrZTOPICr�?z/name of the topic or component to show help for)�metavar�default�nargs�help)�usageZadd_argument_group�add_argument)�clsrZhelp_grprrr�add_parser_options/szSoSHelper.add_parser_optionscCsB|jjjd�d}dddd�}||kr>|jjj|||�|j_dS)N�.r�cleaner�	collector)�clean�mask�collect)rr�split�replace)rZ_com�_replacerrr�sanitize_topic_component:sz"SoSHelper.sanitize_topic_componentcCs�|jjs|j�tjd�|j�y|j�}WnDtk
rr}z(td|jj�d|���tjd�WYdd}~XnX|r�yt	�}|j
|�|j�Wq�tk
r�}ztd|���WYdd}~Xq�Xntd|jj�d��dS)NrzCould not load help for 'z': �zError loading help: zNo help section found for '�')rr�display_self_help�sys�exitr(�get_obj_for_topic�	Exception�print�HelpSectionZdisplay_help�display)r�klass�errZhtrrr�executeDs"

"zSoSHelper.executec	Cs�ddddddddd	�}d
}|jj|krLtjd|jj�}t|||jj�}nB|j|j|j|jd�}x*|j	�D]\}}|jjj
|�rl|�}PqlW|S)
z�Based on the help topic we're after, try to smartly decide which
        object we need to manipulate in order to get help information.
        Z	SoSReportrZ
SoSCleaner�SoSCollectorZRemoteTransportZClusterZPolicyZ	SoSUpload)�reportzreport.pluginsr r!zcollector.transportszcollector.clusters�policies�uploadNzsos.)zreport.plugins.z	policies.zcollector.transports.zcollector.clusters.)rr�	importlib�
import_module�getattr�_get_plugin_variant�_get_policy_by_name�_get_collect_transport�_get_collect_cluster�items�
startswith)rZ
static_mapr�modZ_helpZ_sec�valuerrrr.\s*
zSoSHelper.get_obj_for_topiccCs2ddlm}|jjjd�d}||kr.||SdS)Nr)�
TRANSPORTSrr)���)Zsos.collector.sosnoderErrr%)rrEZ
_transportrrrr?}s
z SoSHelper._get_collect_transportcCsXddlm}ddl}|j|jjd�}x.|D]&}|d|jjjd�dkr*|dSq*WdS)Nr)r6�clustersrr)rF)	Z
sos.collectorr6Zsos.collector.clustersZ
_load_modulesr!rGrrr%)rr6�sosrGZclusterrrrr@�s

zSoSHelper._get_collect_clustercCsdtjd|jj�}|j�tj|tj�}dd�|D�}x(|D] }|j�r<|j	j
|j��}|Sq<WdS)Nzsos.cSs"g|]}t|dt�r|d�qS)r))�
issubclassr)�.0�mrrr�
<listcomp>�sz1SoSHelper._get_plugin_variant.<locals>.<listcomp>)r:r;rrZload_local_policy�inspectZ
getmembersZisclass�__subclasses__�policyZmatch_plugin)rrCZmemsZpluginsZpluginrrrrr=�s
zSoSHelper._get_plugin_variantcCsl|jjjd�d}ddl}t|jj�}x@|j�D]4}x.t|�D]"}|j	j
�jdd�}||kr>|Sq>Wq0WdS)Nrr)rrOrrF)rrr%Zsos.policies.distrosrr8ZdistrosZget_modulesr�__name__�lowerr&)rZ_topicrHZ_helperrCrOZ_prrrr>�szSoSHelper._get_policy_by_namec	Cs�tdd�}|jdtd��d��|jd�}td�}|jd|�d	��td
�}|jd|�d��|jd
�}|jd�dddddddd�}x2|j�D]&\}}|jdt|�d�|��dd�q�W|j�dS)zhDisplays the help information for this component directly, that is
        help for `sos help`.
        zDetailed help for sos helpz�The 'help' sub-command is used to provide more detailed information on different sub-commands available to sos as well as different components at play within those sub-commands.z�SoS - officially pronounced "ess-oh-ess" - is a diagnostic and supportability utility used by several Linux distributions as an easy-to-use tool for standardized data collection. The most known component of which is z
sos reportz� (formerly sosreport) which is used to collect troubleshooting information into an archive for review by sysadmins or technical support teams.zHow to search using sos helpz$component.$topic.$subtopicz8To get more information on a given topic, use the form 'z'.zsos help report.plugins.kernelz
For example 'zM' will provide more information on the kernel plugin for the report function.zAvailable Help Sectionsz�The following help sections are available. Additional help topics and subtopics may be displayed within their respective help section.
z#Detailed help on the report commandz'Information on the plugin design of sosz!Information on a specific $pluginz"Detailed help on the clean commandz$Detailed help on the collect commandz#Detailed help on the upload commandz+How sos operates on different distributions)r7zreport.pluginszreport.plugins.$pluginr"r$r9r8�	z<36F)�newlineN)r1�add_textr�add_sectionrAr2)	rZ	self_helpZsubsectrZrep_exZ
avail_help�sectionsZsectrDrrrr+�s0

"zSoSHelper.display_self_help)rP�
__module__�__qualname__�__doc__ZdescZconfigure_loggingZload_policyZ
load_probeZarg_defaultsr�classmethodrr(r5r.r?r@r=r>r+�
__classcell__rr)rrr
s 
!

r
c@sHeZdZdZddd�Zdd�Zddd	�Zdd
d�Zddd
�Zdd�Z	dS)r1z�This class is used to build the output displayed by `sos help` in a
    standard fashion that provides easy formatting controls.
    rcCs||_||_||_t�|_dS)a�
        :param title:   The title of the output section, will be prominently
                        displayed
        :type title:    ``str``

        :param content: The text content to be displayed with this section
        :type content:  ``str``

        :param indent:  If the section should be nested, set this to a multiple
                        of 4.
        :type indent:   ``int``
        N)�title�content�indentrrV)rr\r]r^rrrr�s
zHelpSection.__init__cCs
||_dS)z�Set or override the title for this help section

        :param title:   The name to set for this help section
        :type title:    ``str``
        N)r\)rr\rrr�	set_title�szHelpSection.set_titleTcCs,|jr|rdnd}||}|j|7_dS)z�Add body text to this section. If content for this section already
        exists, append the new ``content`` after a newline.

        :param content:     The text to add to the section
        :type content:      ``str``
        z

�
N)r])rr]rS�lnrrrrT�szHelpSection.add_textcCs|j|||�|j|S)acAdd a section of text to the help section that will be displayed
        when the HelpSection object is printed.

        Sections will be printed *in the order added*.

        This will return a subsection object with which block(s) of text may be
        added to the subsection associated with ``title``.

        :param title:   The title of the subsection being added
        :type title:    ``str``

        :param content: The text the new section should contain
        :type content:  ``str``

        :returns:   The newly created subsection for ``title``
        :rtype:     ``HelpSection``
        )�_add_sectionrV)rr\r]r^rrrrUszHelpSection.add_sectioncCs(||jkrtd��t|||�|j|<dS)z�Internal method used to add a new subsection to this help output

        :param title:   The title of the subsection being added
        :type title:    ``str`
        z(A section with that title already existsN)rVr/r1)rr\r]r^rrrrbs
zHelpSection._add_sectioncCslttt|j�t|jd��x&|jj�D]}tt|t|jd��q&Wx$|jD]}td�|j|j	�qJWdS)zWPrint the HelpSection contents, including any subsections, to
        console.
        )�widthZinitial_indentrN)
r0rrr\�TERMSIZEr^r]�
splitlinesrVr2)rraZsectionrrrr2&szHelpSection.displayN)rrr)T)rr)rr)
rPrWrXrYrr_rTrUrbr2rrrrr1�s




r1)rMr:r,�os�collectionsr�textwraprZ
sos.componentrZsos.policiesrZsos.report.pluginsrZ
sos.utilitiesrr�min�get_terminal_size�columnsrdr/r
r1rrrr�<module>s 
@

NineSec Team - 2022