• File: proxy.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/lib/python2.7/site-packages/redhat_support_lib/infrastructure/proxy.pyc
  • Date Modified: 03/28/2024 3:28 PM
  • File size: 6.35 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit

fc@sddlmZmZddlmZddlmZddlmZddlZddl	Z	ddl
Z
ddlZe	jdZ
defdYZdS(	i(tRequestErrortConnectionError(tparams(t
paramsjson(turlparseNs'redhat_support_lib.infrastructure.proxytProxycBseZdZidZdZidZd
idZd
idZd
idZ	d
idZ
d
d
d
dZd
id	Zd
id
Z
dZedZRS(s%
    The proxy to web connection
    cCs||_||_dS(sConstructor.N(t_Proxy__connections_pooltheaders(tselftconnections_poolR((sK/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/proxy.pyt__init__!s	cCs|jS(N(R(R((sK/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/proxy.pytgetConnectionsPool&scCs|jddd|d|S(s
        Returns a 2 tuple consisting of the response body as strata.xml.params.* object and the returned
        HTTP headers for inspection.
        tmethodtGETturlR(trequest(RRR((sK/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/proxy.pytget)scCs|jd|||S(sy
        Returns a 2 tuple consisting of the response body and the returned
        HTTP headers for inspection.
        tDELETE(R(RRtbodyR((sK/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/proxy.pytdelete0scCs|jd|||S(s
        Returns a 2 tuple consisting of the response body as strata.xml.params.* object and the returned
        HTTP headers for inspection.
        tPUT(R(RRRR((sK/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/proxy.pytupdate7scCs|jd|||S(s
        Returns a 2 tuple consisting of the response body as strata.xml.params.* object and the returned
        HTTP headers for inspection.
        tPOST(R(RRRR((sK/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/proxy.pytadd>scCs|jd|||S(s
        Returns a 2 tuple consisting of the response body as strata.xml.params.* object and the returned
        HTTP headers for inspection.
        R(R(RRRR((sK/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/proxy.pytactionEscCs|jj}ztyH|j|||||}tjd|j|jdkr|j}tjd||f|j}	tj	|}
yt
j|
d}Wn`tk
r
|
d}t
j
d|jdd|jdd|jdd|d	|}nX||	fStjd
|j|j|jft|j|j|jWn%tjk
r}
tt|
nXWd|jXdS(s
        Upload a file.
        Returns a 2 tuple consisting of the response body as strata.xml.params.* object and the returned
        HTTP headers for inspection.
        sHTTP response status(%s) isresponse data for %s
(%s)it
caseNumbertuuidtlinktfileNametdescriptions1HTTP status(%s) HTTP reason(%s) HTTP response(%s)N(Rt
getConnectiontdoUploadtloggertdebugtstatustreadt
getheaderstjsontloadsRtCaseAttachmentfromdictt	ExceptiontCaseAttachmentRtreasonRtsocketterrorRtstrtclose(RRRt	fileChunkRt
user_agenttconntresponsetresRtres_jsontdoctatt_detailste((sK/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/proxy.pytuploadLs2



&"c	CsKtjd||||f|j||d|d|d|jjS(s
        Returns a 2 tuple consisting of the response body as strata.xml.params.* object and the returned
        HTTP headers for inspection.
        s6Proxy.request: method(%s) url(%s) body(%s) headers(%s)RRR1(R R!t_Proxy__doRequestRR(RRRRR((sK/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/proxy.pyRqs	c
	CsRz@y|j|j|jd|d|d|d|}tjd|j|jdkr|j}tjd||fd}|dk	r|dk	r|jdk	rt	j
|}n||jfStjd	|j|j|jft
|j|j|jWn%tjk
r>}	tt|	nXWd|jXdS(
NRRRRsHTTP response status(%s) isJSON response data for %s
(%s)ts1HTTP status(%s) HTTP reason(%s) HTTP response(%s)(RRt	doRequestR R!R"R#tNonetstripR%R&R$R*RR+R,RR-R.(
RRRR1RRR2R3R5R7((sK/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/proxy.pyt__doRequest}s$	*&"cCs|jjS(N(Rtget_url(R((sK/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/proxy.pyR?scCst|dS(N(R(R	((sK/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/proxy.pytinstancesN(t__name__t
__module__t__doc__R
RRR<RRRRR8RR9R?tstaticmethodR@(((sK/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/proxy.pyRs	%	(t(redhat_support_lib.infrastructure.errorsRRtredhat_support_lib.xmlRtredhat_support_lib.jsonRRR%tloggingtosR+t	getLoggerR tobjectR(((sK/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/proxy.pyt<module>s