/usr/lib/python2.6/site-packages/swiftclient
NameSizeModeActions
client.py633230644editdlrm
client.pyc549830644editdlrm
command_helpers.py66150644editdlrm
command_helpers.pyc66920644editdlrm
exceptions.py24640644editdlrm
exceptions.pyc18220644editdlrm
multithreading.py75690644editdlrm
multithreading.pyc90710644editdlrm
service.py895930644editdlrm
service.pyc579250644editdlrm
shell.py629740755editdlrm
shell.pyc495480644editdlrm
utils.py74360644editdlrm
utils.pyc92340644editdlrm
version.py12870644editdlrm
version.pyc4620644editdlrm
__init__.py10730644editdlrm
__init__.pyc4060644editdlrm
Edit: /usr/lib/python2.6/site-packages/swiftclient/client.pyc (54983B)
;vVc"@sdZddkZddkZddkZddkZddklZddklZl Z ddk l Z ddk l Zddk lZlZddklZlZddkZdd klZdd klZdd klZlZlZd e _dAZdBZdCZ e!ddDDZ"yddkl#Z#Wn,e$j o dei%fdYZ#nXeei&edjo,ddk'l(Z(dZ)e)ei*i+_,nei-d Z.e.i/e#d!Z0d"d#Z d$Z1d%Z2d&e3fd'YZ4d(e3fd)YZ5d*Z6d+Z7d,Z8d-Z9d.Z:d/Z;d0Z<ddddde>dd1Z?ddd2Z@dddd3ZAddddddde>dd4 ZBdddd5ZCddddd6ZDdddd7ZEdddd8ZFddddddd9ZGddd:ZHddddddddddddddd;ZIdddd<ZJdddddddddd= ZKd>ZLd?e3fd@YZMdS(Es0 OpenStack Swift client library used internally iN(t StrictVersion(tRequestExceptiontSSLError(t http_client(tquote(turlparset urlunparse(tsleepttime(tversion(tClientException(t LengthWrappertReadableToIterabletparse_api_responseis1.0t1is2.0t2is3.0t3iccsx|]}d|VqWdS(s x-%s-meta-N((t.0ttype_((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pys +s t containertaccounttobject(t NullHandlerRcBs#eZdZdZdZRS(cCsdS(N((tselftrecord((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pythandle2scCsdS(N((RR((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pytemit5scCs d|_dS(N(tNonetlock(R((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyt createLock8s(t__name__t __module__RRR(((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyR1s  s2.0.0(tCaseInsensitiveDictcCs*|ot||_n t|_dS(N(R theaders(RR!((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pytprepare_unicode_headers@st swiftclientcCsOtitipdSdg}x_|D]W}|djo|idq(|djo|id|q(|id|q(Wd |jo>x;|d D]+}d ||d |f}|i|qWn|id jo ti}n ti}|d d i||d|i|i |d|i |o|d|ndS(Nscurl -itHEADs -ItGETtPOSTtPUTs -X %ss %sR!s -H "%s: %s"i,sREQ: %stsRESP STATUS: %s %ssRESP HEADERS: %ss RESP BODY: %s(sGETsPOSTsPUT( tloggert isEnabledFortloggingtINFOtappendtstatustdebugtinfotjointreasont getheaders(targstkwargstresptbodyt string_partstelementtheadert log_method((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pythttp_logKs.       t/cCsMtiot|d|St|}t|tot||S|SdS(s Patched version of urllib.quote that encodes utf8 strings before quoting. On Python 3, call directly urllib.parse.quote(). tsafeN(tsixtPY3t_quotet encode_utf8t isinstancetbytes(tvalueR>((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyRjs   cCs*t|tio|id}n|S(Ntutf8(RCR?t text_typetencode(RE((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyRBxscCs|h}xo|iD]a\}}t|}|i}t|tio |itot|}n|||/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pytencode_meta_headers~s   t _ObjectBodycBs>eZdZdZddZdZdZdZRS(s= Readable and iterable object body response wrapper. cCs||_||_dS(s Wrap the underlying response :param resp: the response to wrap :param chunk_size: number of bytes to return each iteration/next call N(R6t chunk_size(RR6RQ((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyt__init__s cCs|ii|S(N(R6tread(Rtlength((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyRSscCs|S(N((R((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyt__iter__scCs-|ii|i}|p tn|S(N(R6RSRQt StopIteration(Rtbuf((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pytnexts cCs |iS(N(RX(R((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyt__next__sN( RRt__doc__RRRRSRURXRY(((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyRPs    tHTTPConnectioncBsYeZddeedddZdZddddZddddZdZRS(c Csc||_t||_|ii|_|ii|_h|_ti|_ d |i _ |ii d jo t d|ii |fn| |id<|o| o||id". This may be overridden on a per-request basis by explicitly setting the user-agent header on a call to request(). :param timeout: socket read timeout value, passed directly to the requests library. :raises ClientException: Unable to handle protocol scheme thttpthttpss#Unsupported scheme "%s" in url "%s"tverifysProxy's missing schemes%s://%stproxieststreamspython-swiftclient-%sttimeoutN(shttpshttps(turlRt parsed_urltnetlocthosttportt requests_argstrequeststSessiontrequest_sessionRR!tschemeR tTruetswiftclient_versiontversion_stringtdefault_user_agent( RRbtproxytcacerttinsecuretssl_compressionRoRat proxy_parsed((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyRRs4     %   cOs|ii||S(s< Final wrapper before requests call, to be patched in tests (Rjtrequest(Rtargtkwarg((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyt_requestsc Cs|djo h}n t|}d|jo|i|d/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyRus       cCs|id||||S(s Use python-requests files upload :param data: Use data generator for chunked-transfer :param files: Use files for default transfer R'(Ru(RR|RyR!Rz((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyt putrequestscs|iii_iiifd}dfd}fd}|i_|i_|i_iS(s. Adapt requests response to httplib interface csiiiS(N(R6R!RI((R(s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyR3 scs|i|S(N(RJ(tktv(t old_getheader(s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyt getheaderscs4iii||}|piin|S(N(R6trawRStclose(R4R5tchunk(R(s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pytreleasing_readsN(R6t status_codeR.RRRR3RS(RR3RR((RRs>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyt getresponses   N( RRRtFalseRRRxRuR}R(((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyR[s  9  cOst||}|i|fS(s4 :returns: tuple of (parsed url, connection object) (R[Rc(RvRwtconn((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pythttp_connection#sc Ks|idd}|idt}|idd}t|d|d|d|\}} d} | i| |idh|d6|d6| i} | i} t|| fh| | | i d}| i d jp| i d jp| oE| o=t d d |i d | i d|id| i d| in|o:tt|}|d} d| |d/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyt get_auth_1_0)s.  /  cKs*|ihdd6t|||||S(Ns2.0t auth_version(tupdatetget_auth_keystone(tauth_urlRRt os_optionsR5((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pytget_keystoneclient_2_0HscCsyh|tjoddkl}nddkl}ddkl}tidit ||fSWnt j ot dnXdS(Ni(tclient(t exceptionstkeystoneclients Auth versions 2.0 and 3 require python-keystoneclient, install it or use Auth version 1.0 which requires ST_AUTH, ST_USER, and ST_KEY environment variables to be set or overridden with -A, -U, or -K.( tAUTH_VERSIONS_V3tkeystoneclient.v3Rtkeystoneclient.v2_0RRR+t getLoggert addHandlerRt ImportErrorR (RtksclientR((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyt_import_keystone_clientOs c$Ks1|idt}|idd}|idd}titiotpt}t|\} } y| i d|d|d|idd|idd |id d |id d |id d |id d |id d|idd|idd|d|idd|d|d|} Wnf| i j o0d} |t jo d} nt | n)| i j o} t d| nX|idpd}|idpd}y4| iiddd|idd|d|}Wn&| ij ot d|nX|| ifS( sr Authenticate against a keystone server. We are using the keystoneclient library for authentication. RrRaRs2.0tusernametpasswordt tenant_namet tenant_idtuser_idtuser_domain_nametuser_domain_idt project_namet project_idtproject_domain_nametproject_domain_idR/RqRs:Unauthorized. Check username, password and tenant name/id.sYUnauthorized. Check username/id, password, tenant name/id and user/tenant domain name/id.sAuthorization Failure. %st service_types object-storet endpoint_typet publicURLtattrtregiont filter_valuet region_names8Endpoint for %s not found - have you specified a region?N(RRRR)R*R+tDEBUGRlRtClientt UnauthorizedRR tAuthorizationFailuretservice_catalogturl_fortEndpointNotFoundt auth_token(RRRRR5RrRaRR/RRt _ksclienttmsgterrRRtendpoint((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyRbsP      c Ks|idd}|idh}d\}}|idd}|idt} |idd} |tjo:t||||idd|d| d| \}}n*|ttjo|o;|id o*d |jo|id \|d<}n|ido|d|d/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pytget_authsH  %     cCsl|dj o[h}x*|iD]\}}|||i/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pytstore_responses    c Cs|pt|}n|ot|||||||} | d} xX| oP| dd}t|||||||d} | o| di| qIqIW| S|\} } d} |o| dt|7} n|o| d|7} n|o| dt|7} n|o| dt|7} nd | i| f}h|d 6}|o||d /tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyRs\      *     c Cs<|o|\}}nt|\}}d}h|d6}|o||d/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyt head_account2s*        c Cs|o|\}}nt|\}}d}||d<|o||d/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyt post_accountVs(            c Cs:| pt|} n| ot|||||||||| | } | d} x| o|p| dd}n$| did| did}t|||||||||| | d} | o| di| qUqUW| S| \}}d|it|f}d}|o|dt|7}n|o|d|7}n|o|d t|7}n|o|d t|7}n|o|d t|7}n|o|d t|7}nh|d 6}| o| |d/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyR~st   #            cCs|o|\}}nt|\}}d|it|f}d} h|d6} |o|| d/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pythead_containers4   %     c Csu|o|\}}nt|\}}d|it|f} d} |p h}n||d<|o||d/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pys s t0sContent-LengthR(s%s%sR!ii,sContainer PUT failedRRRRRRN(RRRRuRRSRR<RR.R RkReR2( RbRRR!RRRRRRR{R6R7((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyt put_containers0     %   c Csd|o|\}}nt|\}}d|it|f} d} ||d<|o||d/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pys Es RsContent-LengthR(s%s%sR!ii,sContainer POST failedRRRRRRN(RRRRuRRSR<RRR.R RkReR2( RbRRR!RRRRRRR{R6R7((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pytpost_container,s,   %    c CsB|o|\}}nt|\}}d|it|f}h|d6} |o|| d/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pytdelete_containerWs(   %    c Cs|o|\} } nt|\} } d| it|t|f} |o| d|7} nd} |o |inh}||d<| o| |d/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyt get_objects@"      %    %cCsq|o|\}}nt|\}}d|it|t|f}d} h|d6} |o|| d/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyt head_objects."   %   cCs| o| \}}nt|d| \}}|i}|o#d|idt|f}n|o#d|idt|f}n| o|d| 7}n| ot| } nh} |o|| d/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyt put_objectsr& ##           %   c CsB|o|\}} nt|\}} d|it|t|f} ||d<|o||d/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyt post_objectVs$"   %  c Cs|o|\} } nt|d|\} } | i} |o#d| idt|f} n|o#d| idt|f} n|o| d|7} n|ot|}nh}|o||d/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyt delete_object~s: ##  %    cCs|\}}|id|id|i}|i}t|idfhhd6|||idjp|idjoCtdd|id|i d |id |id |i d |nh}x*|i D]\}}|||i /tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pytget_capabilitiess    &     t ConnectioncBsaeZdZddddddeddddddeeeddZdZdZdZ dd Z d Z d Z d Z dddded ZddZdZddddddedZdddZddZddZdZdddddZddddddddZddZdddZddZRS(s{ Convenience class to make requests that will also retry the request Requests will have an X-Auth-Token header whose value is either the preauthtoken or a token obtained from the auth service using the user credentials provided as args to the constructor. If os_options includes a service_username then requests will also have an X-Service-Token header whose value is a token obtained from the auth service using the service credentials. In this case the request url will be set to the storage_url obtained from the auth service for the service user, unless this is overridden by a preauthurl. iii@RcCsG||_||_||_||_d|_d|_||_||_| |_ | |_ t | ph|_ | o| |i d/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyRRs6&                  cCs|ioqt|ito^t|idjoH|id}t|do't|io|id|_q{ndS(NiR(RRCttupletlenRtcallableRR(RR((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyR#s    cCsmt|i|i|id|id|id|id|id|id|i \|_ |_ |i |i fS(NRRRRqRrRa( RRRRRRRRqRrRaRbR(R((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyR-s     cCs|i}h}|idd|d<|idd|d<|idd|d<|idd}|idd}t|i||d|id|id |d |id |id |i S( Ntservice_project_nameRRRRt service_keyRRRRqRrRa( RRRRRRRRqRrRa(Rtoptstservice_optionst service_userR((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pytget_service_auth7s         c Cs?t|o|n|id|id|id|id|iS(NRqRrRsRa(RRbRqRrRsRa(RRb((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyRIs    cCsh|dj oWd|joJ|d}d|jo|di|n|g|d<|i|ndS(NRtresponse_dicts(RR-R(Rt target_dictR5R((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyt_add_response_dictPs    c Os2d|_t}|i}|idd}x|i|ijo|id7_y|i p |i o%|i\|_|_d|_ n|i o0|i o%|i \|_|_ d|_ nt |_|i p|i|_ n|i |d<|dj oh|d/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyt_retryYsr              !  cCs|idtS(s Wrapper for :func:`head_account`N(R3RR(R((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyRsc Cs.|idtd|d|d|d|d|S(sWrapper for :func:`get_account`RRRRRN(R3RR(RRRRRR((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyRs cCs|idt|d|S(s Wrapper for :func:`post_account`RN(R3RR(RR!R((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyRscCs|idt|S(s"Wrapper for :func:`head_container`N(R3RR(RR((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyRsc Cs=|idt|d|d|d|d|d|d|d|S( s!Wrapper for :func:`get_container`RRRRRRRN(R3RR( RRRRRRRRR((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyRs cCs|idt|d|d|S(s!Wrapper for :func:`put_container`R!RN(R3RR(RRR!R((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyRscCs|idt||d|S(s"Wrapper for :func:`post_container`RN(R3RR(RRR!R((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyRscCs|idt|d|S(s$Wrapper for :func:`delete_container`RN(R3RR(RRR((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyRscCs|idt||S(sWrapper for :func:`head_object`N(R3RR(RRtobj((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyRsc Cs.|idt||d|d|d|d|S(sWrapper for :func:`get_object`RRRR!N(R3RR(RRR4RRRR!((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyRsc sfd} t|tp| o d } nl| } |idjoUt|dd } t|dd | o&o| fd} qn|i| t|d|d|d|d |d |d | d | S(sWrapper for :func:`put_object`cstdfdS(NsNput_object(%r, %r, ...) failure and no ability to reset contents for reupload.(R (R4R5(R4R(s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyt_default_resetsittelltseekcs S(((taR~(torig_posR7(s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pytsRRRQRR!RRN(RCRRRtgetattrR3R (RRR4RRRRQRR!RRR5R-R6((R7RR9R4s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyR s     cCs|idt|||d|S(sWrapper for :func:`post_object`RN(R3RR (RRR4R!R((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyR sc Cs"|idt||d|d|S(s!Wrapper for :func:`delete_object`RRN(R3RR (RRR4RR((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyR scCsv|p|i}|p|i\}}nt|i}t|i}|d|d}|i|}t|S(Ns://s/info(RbRRRkRdRR(RRbt_RkRdR((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyRsN(RRRZRRRlRRRRR#RR&R3RRRRRRRRRRR R R R(((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyRsD     >   ;             (s1.0Ri(s2.0Ri(s3.0Ri(s containerRsobject(NRZR(RhR+Rtdistutils.versionRtrequests.exceptionsRRt six.movesRtsix.moves.urllib.parseRRARRRRR?R#R Rmtswiftclient.exceptionsR tswiftclient.utilsR R R t _MAXHEADERSRRRRRMRRtHandlert __version__trequests.structuresR R"tmodelstPreparedRequesttprepare_headersRR)RR<RBRORRPR[RRRRRRRRRRRRRRRRRRRR R R RR(((s>/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/client.pyts              w     4 E    B$ ' R +,*'? (   j'  8