PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB` 3 ([Qhk+ @sddlZddlZddlZddlZddlmZddlmZddlm Z ddl m Z ddl m Z ddlmZmZyeejjdZWnek rdZYnXGd d d e ZGd d d ZdS) N) OrderedDict)fill) SoSComponent) import_policy)Plugin)boldImporterHelperxcseZdZdZdZdZdZdZddiZfddZ e dd Z d d Z d d Z ddZddZddZddZddZddZZS) SoSHelperzProvide better, more in-depth help for specific parts of sos than is provided in either standard --help output or in manpages. zDetailed help infomationFtopiccstj||||jj|_dS)N)super__init__optsr )selfparserargsZcmdline) __class__/usr/lib/python3.6/__init__.pyr+szSoSHelper.__init__cCs*d|_|jdd}|jdddddd dS) Nzsos help TOPIC [options]zHelp Information Optionsz|jjj||||j_dS)N.rcleaner collector)cleanmaskcollect)rr splitreplace)rZ_com_replacerrrsanitize_topic_component:s z"SoSHelper.sanitize_topic_componentcCs|jjs|jtjd|jy |j}WnDtk rr}z(td|jjd|tjdWYdd}~XnX|ryt }|j ||j Wqtk r}ztd|WYdd}~XqXntd|jjddS)NrzCould not load help for 'z': zError loading help: zNo help section found for '') rr display_self_helpsysexitr(get_obj_for_topic Exceptionprint HelpSectionZ display_helpdisplay)rklasserrZhtrrrexecuteDs"    "zSoSHelper.executec Csddddddddd }d }|jj|krLtjd |jj}t|||jj}nB|j|j|j|jd }x*|j D]\}}|jjj |rl|}PqlW|S) zBased 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.clusterspoliciesuploadNzsos.)zreport.plugins.z policies.zcollector.transports.zcollector.clusters.) rr importlib import_modulegetattr_get_plugin_variant_get_policy_by_name_get_collect_transport_get_collect_clusteritems startswith)rZ static_maprmodZ_helpZ_secvaluerrrr.\s*  zSoSHelper.get_obj_for_topiccCs2ddlm}|jjjdd}||kr.||SdS)Nr) TRANSPORTSrr))Zsos.collector.sosnoderErr r%)rrEZ _transportrrrr?}s  z SoSHelper._get_collect_transportcCsXddlm}ddl}|j|jjd}x.|D]&}|d|jjjddkr*|dSq*WdS)Nr)r6clustersrr)rF) Z sos.collectorr6Zsos.collector.clustersZ _load_modulesr!rGrr r%)rr6sosrGZclusterrrrr@s    zSoSHelper._get_collect_clustercCsdtjd|jj}|jtj|tj}dd|D}x(|D] }|jr<|j j |j}|Sqsz1SoSHelper._get_plugin_variant..) r:r;rr Zload_local_policyinspectZ getmembersZisclass__subclasses__policyZ match_plugin)rrCZmemsZpluginsZpluginrrrrr=s zSoSHelper._get_plugin_variantcCsl|jjjdd}ddl}t|jj}x@|jD]4}x.t|D]"}|j j j dd}||kr>|Sq>Wq0WdS)Nrr)rrOr rF) rr r%Zsos.policies.distrosrr8ZdistrosZ get_modulesr__name__lowerr&)rZ_topicrHZ_helperrCrOZ_prrrr>s  zSoSHelper._get_policy_by_namec Cstdd}|jdtdd|jd}td}|jd|d td }|jd |d |jd }|jddddddddd}x2|jD]&\}}|jdt|d|ddqW|jdS)zhDisplays the help information for this component directly, that is help for `sos help`. zDetailed help for sos helpzThe '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.zSoS - 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 SectionszThe 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)r1add_textr add_sectionrAr2) rZ self_helpZsubsectrZrep_exZ avail_helpsectionsZsectrDrrrr+s0  "zSoSHelper.display_self_help)rP __module__ __qualname____doc__ZdescZconfigure_loggingZ load_policyZ load_probeZ arg_defaultsr classmethodrr(r5r.r?r@r=r>r+ __classcell__rr)rrr s    !   r c@sHeZdZdZdddZddZddd Zdd d Zdd d ZddZ dS)r1zThis 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)titlecontentindentrrV)rr\r]r^rrrrs zHelpSection.__init__cCs ||_dS)zSet 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_titleszHelpSection.set_titleTcCs,|jr|rdnd}||}|j|7_dS)zAdd 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]rSlnrrrrTs 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(||jkrtdt||||j|<dS)zInternal 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|jt|jdx&|jjD]}tt|t|jdq&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_rTrUrbr2rrrrr1s   r1)rMr:r,os collectionsrtextwraprZ sos.componentrZ sos.policiesrZsos.report.pluginsrZ sos.utilitiesrrminget_terminal_sizecolumnsrdr/r r1rrrr s       @