404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.147.103.33: ~ $
3

�f5+�@s�ddlZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlm
Z
mZddlmZyeej�jd�ZWnek
r�dZYnXGd	d
�d
e�ZGdd�d�ZdS)
�N)�OrderedDict)�SoSComponent)�
import_policy)�Plugin)�bold�ImporterHelper)�fill�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�cs"tt|�j|||�|jj|_dS)N)�superr
�__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�}Wn@tk
rn}z$td|jj|f�tjd�WYdd}~XnX|r�yt	�}|j
|�|j�Wq�tk
r�}ztd|�WYdd}~Xq�Xntd|jj�dS)Nrz Could not load help for '%s': %s�zError loading help: %szNo help section found for '%s')rr�display_self_help�sys�exitr(�get_obj_for_topic�	Exception�print�HelpSectionZdisplay_help�display)r�klass�errZhtrrr�executeDs"

 zSoSHelper.executecCs�dddddddd�}d	}|jj|krJtjd
|jj�}t|||jj�}n>|j|j|j|jd�}x&|D]}|jjj	|�rf||�}PqfW|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�SoSCollectorZRemoteTransportZClusterZPolicy)�reportzreport.pluginsr r!zcollector.transportszcollector.clusters�policiesNzsos.)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�
startswith)rZ
static_mapr�modZ_helpZ_secrrrr-\s(


zSoSHelper.get_obj_for_topiccCs2ddlm}|jjjd�d}||kr.||SdS)Nr)�
TRANSPORTSrr)���)Zsos.collector.sosnoderArrr%)rrAZ
_transportrrrr=|s
z SoSHelper._get_collect_transportcCsXddlm}ddl}|j|jjd�}x.|D]&}|d|jjjd�dkr*|dSq*WdS)Nr)r5�clustersrr)rB)	Z
sos.collectorr5Zsos.collector.clustersZ
_load_modulesr!rCrrr%)rr5�sosrCZclusterrrrr>�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>)r8r9rrZload_local_policy�inspectZ
getmembersZisclass�__subclasses__�policyZmatch_plugin)rr@ZmemsZpluginsZpluginrrrrr;�s
zSoSHelper._get_plugin_variantcCsl|jjjd�d}ddl}t|jj�}x@|j�D]4}x.t|�D]"}|j	j
�jdd�}||kr>|Sq>Wq0WdS)Nrr)rrKrrB)rrr%Zsos.policies.distrosrr7ZdistrosZget_modulesr�__name__�lowerr&)rZ_topicrDZ_helperr@rKZ_prrrr<�szSoSHelper._get_policy_by_namecCs�tdd�}|jdtd��|jd�}td�}|jd|�td�}|jd	|�|jd
�}|jd�dd
ddddd�}x.|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.ahSoS - 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 %s (formerly sosreport) which is used to collect troubleshooting information into an archive for review by sysadmins or technical support teams.z
sos reportzHow to search using sos helpz$component.$topic.$subtopicz<To get more information on a given topic, use the form '%s'.zsos help report.plugins.kernelz\For example '%s' 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+How sos operates on different distributions)r6zreport.pluginszreport.plugins.$pluginr"r$r7�	z<36F)�newlineN)r0�add_textr�add_sectionr1)rZ	self_helpZsubsectrZrep_exZ
avail_help�sectionsZsectrrrr*�s8


zSoSHelper.display_self_help)rL�
__module__�__qualname__�__doc__ZdescZconfigure_loggingZload_policyZ
load_probeZarg_defaultsr�classmethodrr(r4r-r=r>r;r<r*�
__classcell__rr)rrr
s 
 

r
c@sHeZdZdZddd�Zdd�Zddd	�Zdd
d�Zddd
�Zdd�Z	dS)r0z�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�indentrrR)rrXrYrZrrrr�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)rX)rrXrrr�	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)rY)rrYrO�lnrrrrP�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_sectionrR)rrXrYrZrrrrQszHelpSection.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)rRr.r0)rrXrYrZrrrr^s
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)
r/rrrX�TERMSIZErZrY�
splitlinesrRr1)rr]Zsectionrrrr1'szHelpSection.displayN)rrr)T)rr)rr)
rLrSrTrUrr[rPrQr^r1rrrrr0�s




r0)rIr8r+�os�collectionsrZ
sos.componentrZsos.policiesrZsos.report.pluginsrZ
sos.utilitiesrr�textwrapr�min�get_terminal_size�columnsr`r.r
r0rrrr�<module>s 
A

Filemanager

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