|
Server : LiteSpeed System : Linux host 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64 User : idnco5810 ( 1093) PHP Version : 8.2.29 Disable Function : NONE Directory : /usr/lib/python3/dist-packages/sos/help/__pycache__/ |
Upload File : |
o
([Qhk+ � @ s� d dl Z d dlZd dlZd dlZd dlmZ d dlmZ d dlm Z d dl
mZ d dlm
Z
d dlmZmZ z
ee�� jd�ZW n eyK dZY nw G d d
� d
e �ZG dd� d�ZdS )
� N)�OrderedDict)�fill)�SoSComponent)�
import_policy)�Plugin)�bold�ImporterHelper�x c s� e Zd ZdZdZdZdZdZddiZ� fdd�Z e
dd � �Zd
d� Zdd
� 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� c s t � �|||� | jj| _d S )N)�super�__init__�optsr )�self�parser�args�cmdline�� __class__� �3/usr/lib/python3/dist-packages/sos/help/__init__.pyr + s zSoSHelper.__init__c C s* d|_ |�dd�}|jdddddd � d S )
Nzsos help TOPIC [options]zHelp Information Optionsz<These options control what detailed information is displayedr �TOPICr �?z/name of the topic or component to show help for)�metavar�default�nargs�help)�usage�add_argument_group�add_argument)�clsr �help_grpr r r �add_parser_options/ s �
�zSoSHelper.add_parser_optionsc C sF | j j�d�d }dddd�}||v r!| j j�||| �| j _d S d S )N�.r �cleaner� collector)�clean�mask�collect)r r �split�replace)r �_com�_replacer r r �sanitize_topic_component: s ��z"SoSHelper.sanitize_topic_componentc
C s� | j js
| �� t�d� | �� z| �� }W n# ty: } ztd| j j� d|� �� t�d� W Y d }~nd }~ww |rgzt � }|�
|� |�� W d S tyf } ztd|� �� W Y d }~d S d }~ww td| j j� d�� d S )Nr zCould not load help for 'z': � zError loading help: zNo help section found for '�')r r �display_self_help�sys�exitr. �get_obj_for_topic� Exception�print�HelpSection�display_help�display)r �klass�err�htr r r �executeD s*
��
��zSoSHelper.executec C s� ddddddddd �}d
}| j j|v r't�d| j j �}t||| j j �}|S | j| j| j| jd�}|� � D ]\}}| j j�
|�rG|� } |S q6|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.
� SoSReportr �
SoSCleaner�SoSCollector�RemoteTransport�Cluster�Policy� SoSUpload)�report�report.pluginsr% r&