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 :  /lib/python2.7/site-packages/redhat_support_tool/plugins/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pyo
�
��Tc@s�ddlmZddlmZddlmZmZddlmZm	Z	ddl
mZddlm
Z
mZddlZddljjZddljjZdZejd	�Zd
e
fd��YZdS(i����(tdeque(tOption(tRequestErrortConnectionError(tEmptyValueErrort_(t	Constants(tInteractivePlugint
DisplayOptionNs&Spenser Shumaker <sshumake@redhat.com>s'redhat_support_tool.plugins.modify_caset
ModifyCasecBs+eZdZed�ZdZdZdZdZ	dZ
ed��Zed��Z
ed��Zed��Zd�Zd�Zd�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zdd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#RS(t
modifycasesModify casecCs
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 CASENUMBER(R(tcls((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.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
        s9Use the '%s' command to modify a specific case by number.(Rtplugin_name(R((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.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
        s"Example:
  - %s <case number here>(RR
(R((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pyt
get_epilogAs	cCs�tdddddtd�dd�tdd	dd
dtd�dd�tdd
dddtd�dd�tdddddtd�dd�tdddddtd�dd�tdddddtd�dd�gS(sO
        Subclasses that need command line options should override this method
        and return an array of optparse.Option(s) to be used by the
        OptionParser.

        Example:
         return [Option("-f", "--file", action="store",
                        dest="filename", help='Some file'),
                 Option("-c", "--case",
                        action="store", dest="casenumber",
                        help='A case')]

         Would produce the following:
         Command (? for help): help mycommand

         Usage: mycommand [options]

         Use the 'mycommand' command to find a knowledge base solution by ID
         Options:
           -h, --help  show this help message and exit
           -f, --file  Some file
           -c, --case  A case
         Example:
          - mycommand -c 12345 -f abc.txt

        s-ts--typetdestttypethelpsthe type of casetdefaults-Ss
--severitytseveritysthe severity for the cases-ss--statuststatussthe status for the cases-as--alternative-idtaidsaAn alternative-id for the cases-ps	--producttproducts&the product the case is opened againsts-vs	--versiontversions5the version of the product the case is opened againstN(RRtNone(R((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pytget_optionsOs$cCs
td�S(NsR
Type the number of the attribute to modify or 'e' to return to the previous menu.(R(tself((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pytget_intro_textscCs
td�S(NsSelection: (R(R((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pytget_prompt_text�scCs|jS(N(t
_submenu_opts(R((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pytget_sub_menu_options�scCs�td�|j}d|_|jr=dj|j�|_n�tj�r�ttd��}t|�j	�}|dkr�t
��nt|�j	�r�||_q�|GHt
|��n|GHt
|��dS(Ns!ERROR: %s requires a case number.tt s/Please provide a case number (or 'q' to exit): tq(RR
t_caseNumbert_argstjointcommontis_interactivet	raw_inputtstrtstript	Exception(Rtmsgtline((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pyt_check_case_number�s 	
		cCs�|jdr�t}xJtj�D]<}|jdj�|j�kr t}||jd<Pq q W|s�td�}|GHt|��q�ndS(NRsERROR: Invalid type specified.(t_optionstFalseR&t	get_typestlowertTrueRR+(RtmatchtcasetypeR,((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pyt_check_type�s

cCs�|jdr}t}xJtj�D]<}|jdj�|j�kr t}||jd<Pq q W|s}td�}|GHq}ndS(NRs"ERROR: Invalid severity specified.(R/R0R&tget_severitiesR2R3R(RR4RR,((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pyt_check_severity�s

cCs�|jdr�t}xJtj�D]<}|jdj�|j�kr t}||jd<Pq q W|s�td�}|GHt|��q�ndS(NRs ERROR: Invalid status specified.(R/R0R&tget_statusesR2R3RR+(RR4RR,((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pyt
_check_status�s

cCs�|jdr�d|_tj�|_t}x4|jD])}|j�|jdkr5t}Pq5q5W|s�td�}|GHt	|��q�ndS(NRs ERROR: Invalid product provided.(
R/Rt_productsAryR&tget_productsR0tget_nameR3RR+(RtinArrayRR,((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pyt_check_prod�s
	cCs�|jdr�d}|jddkr8|jj�}n
|jd}|js`tj�|_nx3|jD](}||j�krj|j�}PqjqjW|jd|kr�t	d�}|GHt
|��q�ndS(NRRs ERROR: Invalid version provided.(R/Rt_casetget_productR;R&R<R=tget_versionsRR+(RtversionsRtprodR,((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pyt
_check_ver�s

	cCs6|j�|j�|j�|j�|j�dS(N(R.R6R8R:R?(R((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pyt
validate_args�s




cCsPt�|_i|_d}y<tj�}|jj|j�|_	|j
�|j�Wn�tk
r�}t
d�t|�}|GHtjtj|��n�tk
r�}t
d�|j}|GHtjtj|��notk
rt
d�}|GHtjtj|��n8tk
rKt
d�}|GHtjtj|��nXdS(Ns	ERROR: %ss5Unable to connect to support services API. Reason: %ssZProblem connecting to the support services API.  Is the service accessible from this host?sProblem updating case(RRt	_sectionsRt	apihelpertget_apitcasestgetR#R@REt_createDisplayOptsRRR)tloggertlogtloggingtWARNINGRtreasonRR+(RtapiteveR,tre((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pytpostinit�s:	
	


cCs0ttjd�}|jj|�tj|j|<ttjd�}|jj|�tj|j|<ttjd�}|jj|�tj|j|<ttjd�}|jj|�tj|j|<ttj	d�}|jj|�tj	|j|<ttj
d�}|jj|�tj
|j|<dS(Ntinteractive_action(RRtCASE_MODIFY_TYPERtappendRGtCASE_MODIFY_SEVERITYtCASE_MODIFY_STATUStCASE_MODIFY_AIDtCASE_MODIFY_PRODtCASE_MODIFY_VER(Rtdisp_opt((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pyRLs0												cCs�|jdr'|jj|jd�n|jdrN|jj|jd�n|jdru|jj|jd�n|jdr�|jj|jd�n|jdr�|jj|jd�n|jdr�|jj|jd�n|jj�dS(NRRRRRR(	R/R@tset_typetset_severityt
set_statustset_alternateIdtset_producttset_versiontupdate(R((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pytnon_interactive_action8s





cCs�|jtjkr`|j�r�|jj|jd�|jj�td�|jj	�GHq�n"|jtj
kr�|j�r�|jj|jd�|jj�td�|jj	�GHq�n�|jtj
kr |j�r�|jj|jd�|jj�td�|jj	�GHq�nb|jtjkr�|j�r�|jj|jd�|jj�td�|jj	�GHq�n|jtjkr"|j�r�|jd|jj�kr�|j�r�|jj|jd�n|jj|jd�|jj�td�|jj	�GHq�n`|jtjkr�|j�r�|jj|jd�|jj�td�|jj	�GHq�ndS(NRsSuccessfully updated case %sRRRRR(tdisplay_textRRWt	_get_typeR@R_R/ReRtget_caseNumberRYt
_get_severityR`RZt_get_statusRaR[t_get_aidRbR\t	_get_prodRAt_get_verRdRcR](Rtdisplay_option((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pyRVGsN
	
	
	
	
	
	cCs�tj�}tj|�x�tr�ttd��}t|�j�dkrPtSyt	|�}Wntd�GHnX|t
dt|�d�kr�|dkr�||d|jd<Pqtd�GHqWtS(Ns'Please select a type (or 'q' to exit): R"sERROR: Invalid type selection.iR R(
R&R1tprint_typesR3R(RR)R*R0tinttrangetlenR/(RttypesAryR-((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pyRhss
	+cCs�tj�}tj|�x�tr�ttd��}t|�j�dkrPtSyt	|�}Wntd�GHnX|t
dt|�d�kr�|dkr�||d|jd<Pqtd�GHqWtS(Ns+Please select a severity (or 'q' to exit): R"s"ERROR: Invalid severity selection.iR R(
R&R7tprint_severitiesR3R(RR)R*R0RqRrRsR/(Rt
severitiesAryR-((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pyRj�s
	+cCs�tj�}tj|�x�tr�ttd��}t|�j�dkrPtSyt	|�}Wntd�GHnX|t
dt|�d�kr�|dkr�||d|jd<Pqtd�GHqWtS(Ns)Please select a status (or 'q' to exit): R"s ERROR: Invalid status selection.iR R(
R&R9tprint_statusesR3R(RR)R*R0RqRrRsR/(RtstatusesAryR-((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pyRk�s
	+cCsmxftrhttd��}t|�j�}|dkr=tS|dkrZ||jd<Pqtd�GHqWtS(Ns2Please provide a alternative-id (or 'q' to exit): R"R Rs'ERROR: Invalid alternative-id provided.(R3R(RR)R*R0R/(RR-((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pyRl�s	
cCs�tj�|_tj|j�x�tr�ttd��}t|�j�dkrVt	Syt
|�}Wntd�GHnX|tdt|j�d�kr�|dkr�|j|dj
�|jd<Pq"td�GHq"WtS(Ns*Please select a product (or 'q' to exit): R"s!ERROR: Invalid product selection.iR R(R&R<R;tprint_productsR3R(RR)R*R0RqRrRsR=R/(RR-((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pyRm�s	.cCsMd}|jddkr2|jj�|jd<n|jsMtj�|_nx:|jD]/}|jd|j�krW|j�}PqWqWWtj	|�x�t
rHttd��}t
|�j�dkr�tSyt|�}Wntd�GHnX|tdt|j�d�kr:|dkr:||d|jd<Pq�td�GHq�Wt
S(NRs*Please select a version (or 'q' to exit): R"s!ERROR: Invalid version selection.iR R(RR/R@RAR;R&R<R=RBtprint_versionsR3R(RR)R*R0RqRrRs(RRCRR-((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pyRn�s.	
	.N($t__name__t
__module__R
RtALLRRRGR#R@R;tclassmethodRRRRRRRR.R6R8R:R?RERFRURLRfRVRhRjRkRlRmRn(((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pyR	!s>0					
		
				#	%	,					(tcollectionsRtoptparseRt(redhat_support_lib.infrastructure.errorsRRt(redhat_support_tool.helpers.confighelperRRt%redhat_support_tool.helpers.constantsRtredhat_support_tool.pluginsRRROt%redhat_support_tool.helpers.apihelperthelpersRHt"redhat_support_tool.helpers.commonR&t
__author__t	getLoggerRMR	(((sK/usr/lib/python2.7/site-packages/redhat_support_tool/plugins/modify_case.pyt<module>s

https://t.me/AnonymousX5 - 2025