/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/service.pyc (57925B)
;vVc@sddkZddkZddklZlZlZddklZddkl Z l Z ddk l Z ddkl Z lZlZlZddklZlZlZlZlZlZlZddklZdd klZdd klZdd kl Z l!Z!dd k"l#Z#dd k"l$Z%ddk&l'Z'l(Z(ddkl)Z)l*Z*ddk+Z+ddk,l-Z-ddk.l/Z/l0Z0l1Z1ddk2l3Z3l4Z4l5Z5l6Z6l7Z7l8Z8ddk9l:Z:ddk;l<Z<ei=dZ>de)fdYZ?de@fdYZAdZBdZCeCZDhdd6dd6eFd6dd6dd 6eFd!6dd"6eFd#6eFd$6dd%6dd&6dd'6dd(6eFd)6eFd*6eFd+6eFd,6d-d.6gd/6gd06dd16dd26eFd36eFd46eFd56eGd66eFd76ZHd8ZId9d:ZJd;d<ZKd;d=ZLd>ZMd?ZNd-d@ZOdAePfdBYZQdCePfdDYZRdEePfdFYZSdGePfdHYZTdS(IiN(t as_completedtCancelledErrort TimeoutError(tdeepcopy(tEEXISTtENOENT(tmd5(tenvirontmakedirststattutime(tbasenametdirnametgetmtimetgetsizetisdirtjointsep(tshuffle(ttime(tThread(tStringIOt text_type(tQueue(tEmpty(tquotetunquote(tIteratort string_types(t Connection(t stat_accounttstat_containert stat_object(tconfig_true_valuetReadableToIterablet LengthWrappert EMPTY_ETAGtparse_api_responsetreport_traceback(tClientException(tMultiThreadingManagersswiftclient.servicetResultsIteratorcBs#eZdZdZdZRS(cCst||_dS(N(tinterruptable_as_completedtfutures(tselfR+((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyt__init__6scCs|S(N((R,((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyt__iter__9scCst|i}|iS(N(tnextR+tresult(R,tnext_completed_future((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyt__next__<s(t__name__t __module__R-R.R2(((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyR)5s  t SwiftErrorcBs&eZdddddZdZRS(cCs1||_||_||_||_||_dS(N(tvaluet containertobjtsegmentt exception(R,R6R7R8R9texc((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyR-Bs     cCst|i}|idj o|d|i7}n|idj o|d|i7}n|idj o|d|i7}n|S(Ns container:%ss object:%ss segment:%s(treprR6R7tNoneR8R9(R,R6((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyt__str__JsN(R3R4R=R-R>(((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyR5AscCsx|ido|ido |id o$|iddjod|d}|io|ii|n|it|7_|Vq W|idS(N(RRtupdateRRt_check_contents(R,tchunk((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyR.Ls   cCs|ioR|ioH|ii}||ijo%tdi|i||iq\n|idj o;|i|ijo(tdi|i|i|indS(Ns1Error downloading {0}: md5sum != etag, {1} != {2}sDError downloading {0}: read_length != content_length, {1:d} != {2:d}( RRt hexdigestR5RRRR=R(R,R((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyRTs    cCs|iS(N(R(R,((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyt bytes_readcs(R3R4RR-R.RR(((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyR4s    t SwiftServicecBseZdZedZdZdZeeedZedZ eeedZ edZ edZ ed Z ed Zeed Zed Zed ZeeedZdZdZdZedZedZeeedZeedZeedZedZdZedZeeedZeedZedZ edZ!dZ"edZ#ed Z$ed!Z%RS("s1 Service for performing swift operations c s|dj otttt|_nttt_tifd}t|diddiddiddid_dS(Ncs tiS((Rt_options((R,(s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pytwsRRRR(R=tdictt_default_global_optionst_default_local_optionsRRfR(tthread_manager(R,Retcreate_connection((R,s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyR-ks      cCs|ii|S(N(Rt __enter__(R,((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyRs cCs|ii|||dS(N(Rt__exit__(R,texc_typetexc_valtexc_tb((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyRscCsS|dj ot|i|}n |i}|ph|otdqOhdd6td6|d6dd6}yM|iiit|}t |\}}|i h|d6|d6|SWqOt j ou}|i d joJt \} } ti||i htd6|d 6| d 6| d 6|Std d|qOtj oO}t \} } ti||i htd6|d 6| d 6| d 6|SXn|p^hdd6|d6dd6td6}yP|iiit||}t |\}}|i h|d6|d6|SWqOt j o}|i d joJt \} } ti||i htd6|d 6| d 6| d 6|Std|d|d|qOtj oO}t \} } ti||i htd6|d 6| d 6| d 6|SXnPg} x<|D]4} |iii|i|| |} | i| q Wt| SdS(s Get account stats, container stats or information about a list of objects in a container. :param container: The container to query. :param objects: A list of object paths about which to return information (a list of strings). :param options: A dictionary containing options to override the global options specified during the service object creation. These options are applied to all stat operations performed by this call:: { 'human': False } :returns: Either a single dictionary containing stats about an account or container, or an iterator for returning the results of the stat operations on a list of objects. :raises: SwiftError s#Objects specified without containerRtactiontsuccessR7tobjecttitemsRiterrort tracebackterror_timestampsAccount not foundR;RsContainer %r not foundN(R=RRR5RRtcontainer_pooltsubmitRRRR't http_statusR&tloggerR:Rt ExceptionRtobject_dd_poolt _stat_objecttappendR)(R,R7tobjectsReRt stats_futureRRRRterr_timet stat_futureststat_ot stat_future((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyR s                           c Cshdd6|d6|d6td6}y>t||||\}}|ih|d6|d6|SWn[tj oO}t\}} ti||ihtd6|d6|d 6| d 6|SXdS( NR RRR7RRRRRR(RR RRR&RR:R( tconnR7R8ReRRRRRR((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyRs(      c Cs|d j ot|i|}n |i}htd6|d6d d6hd6}|pzd|d<|otdnUh}t|dd }|it|d d ||d|D](} x|i| |D] } | VqWqWqj|dqjWWqHtj o2} | i d jont d d | qHXqIn|pId |jot d d|nx|i||D] } | VqWnd |jot d d|n|do!t |djod|dh|idt6}|d jo |}q|i|qn|i||d||ihtd6|d6Wnatj oU}t\} } t i ||iht d6|d6| d 6| d 6|d6nX|S( s Create a container using the given connection :param conn: The swift connection used for requests. :param container: The container name to create. :param headers: An optional dict of headers for the put_container request. :param policy_source: An optional name of a container whose policy we should duplicate. :return: A dict containing the results of the operation. tcreate_containerRR7Rsx-storage-policyRRRRRN( R=RRdRjRR RRR&RR:R( RR7RRcRtcreate_responset_metaRqRRR((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyRks:        cCshdd6|d6|d6|d6}h}|idp|ido|d}n|id o|d }n|dj ohd t|d 6}nhd ttd 6}||d <|do%y|i||}|id} t|id} |id} |id } | idd ddjo:| djo-| t jo | |d jot |d<|SWqt j oc} | i djoJt \}}ti| |ihtd6| d6|d6|d6|SqXnyN|i||dddddd |d||iht d6|d6|SWnbtj oV} t \}}ti| |ihtd6| d6|d6|d6|d6|SXdS(Ntcreate_dir_markerRR7RRs./s.\iR is%fsx-object-meta-mtimeRRs content-typescontent-lengthRR3istext/directoryRiRRRRtcontent_lengthRRR(t startswithR=R troundRt head_objectRdRRR$RR'RR&RR:RRt put_objectR(RR7R8ReRRRGt put_headersRtcttcltettmtRRR((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyRnsp                 c  Csh} |do|d} n |d} hdd6|d6|d6|d6d| |fd 6d ||fd 6} yt|d } | i|t| |d |d}|i| ||d|d| }|do?|o8||ijo%tdi||i|n| ihtd6| d6|d6|i d6| dj o| i | n| SWnt j o~}t \}}ti|| ihtd6|d6|d6|d6| d6|i d6| dj o| i | n| SXdS(NRRbtupload_segmentRt for_objectt segment_indexRs/%s/%stsegment_locations %s segment %stlog_lineR-RRRRstSegment {0}: upload verification failed: md5 mismatch, local {1} != remote {2} (remote segment has not been removed)Rt segment_etagR:RRR(R>tseekR#Rt get_md5sumR5RRRR:R=RRR&RR:R(RRR7t segment_namet segment_startRRtobj_nameReRfRGRRRJR2RRRR((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyt_upload_segment_jobSs\       %       c Csg}d|jon|didd\}}x`|i|h|d6D]0} | do|i| dqI| dqIWnt|ido|djo"|i||d d \}}nt||}x|D]r} | id oO| d ididd\} } |i|i || | ht d6q|i | qWn=|i h|id i dd6t |idd6|S(Nsx-object-manifestR iRRRRsx-static-large-objectR/smultipart-manifest=gettsub_sloRRt"thashscontent-lengthtbytes(RRtextendR!RdR=R@R%R;RARRtstripR( R,RR7R8Rtmanifesttchunkst scontainertsprefixR$Rtsconttsobj((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyRAs.   % "c Csyt|d}Wntj otSX|iizx|D]}|d}t}xM|oE|itd|}|ptS|i||t |8}q_W|i |djotSqCW|id SWdQXdS(NR-RiRi( R>R?RRRRRtminRRR(R,RORRJRtto_readRKRL((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyRBs&    c?Cs6 |idp|ido|d}n|ido|d}nhdd6|d6|d 6}t|d o|}d} n|} | |d 6D]>}4|4dp|4dn|1|2i3d?|4d@DqWn| ojxg| D][}5|5| joq" n|5i0dd\}6}7|1i |6g}8|8i|7|8|1|6n|}>|i htd6|>d6|d6|d 6n[t"j oN}t\}}ti||i htd6|d6|d6|d 6nX|S(FNs./s.\iR iRgRR7RRRs%fsx-object-meta-mtimeRRiRRRsx-static-large-objectRsskipped-identicaltstatusscontent-lengthsskipped-changedsx-object-manifestRsutf-8iRRRRRt large_objectRbRRs%s/slo/%s/%s/%s/%08ds%s/%s/%s/%s/%08dRfsLAborting manifest creation because not all segments could be uploaded. %s/%st exceptionstsegment_resultsRAcSs|dS(R((tdi((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyR]sRRRt size_bytesttrueR/smultipart-manifest=putRtmanifest_response_dicts%s/%s/%s/%s/%s/RR-RRsmObject upload verification failed: md5 mismatch, local {0} != remote {1} (remote object has not been removed)Rcssx|]}|dVqWdS(RN((t.0tseg((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pys s Rtsegment_delete_resultstuploadedR:sLocal file %r not foundR;(:RRR=R RRtsetRRR!RdRARBRRRR;RRtencodeRR'RR&RR:RRRt segment_poolRRR*R0RtsorttaddtjsontdumpsRRtrstripR#R>R"RR5RRRRRRt_delete_segmentR:RRR(?R,RR7RR8ReRfRtstreamRRt old_manifesttold_slo_manifest_pathstnew_slo_manifest_pathsRRtis_sloRORRtold_segtseg_pathRRRRut full_sizetsegment_futuresRR9RRRRterrorsRRRttseg_locR%tdt manifest_datatmrtnew_object_manifesttobrRR2Rtdrst delobjsmapRRR$t seg_to_deleteRRt delobjs_conttdel_segstdsconttdsobjstdsobjtdel_segR((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyRms                                         >                               ccsQ|dj ot|i|}n |i}t}|dj o#|dj oh}xS|D]K}|iii|i|||d|}h|d6|d6}|||+s RRReN(R=RRRRRRt_delete_objectRRoRpRtkeysRZt_delete_containerR5RRRR(R,R7RReRtobj_delsR8tobj_delt obj_detailsRRR~R&R$R'((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pytdeletesb                 c Csh}y'|i||d|htd6}WnStj oG}t\}}ti|htd6|d6|d6|d6}nX|ihdd6|d6|d 6|id 6|d6|dj o|i |n|S( NRRRRRtdelete_segmentRR7RR:( t delete_objectRRR&RR:RRR:R=R( RR7R8RfRGRRRR((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyR=s*     cCshdd6|d6|d6}y$d}d}|dpxyE|i||} | id}t| ido d}nWqtj o } | id joqqXnh} |i||d |d | |oCt} |ii } |i d d \}}t |}t |i d d }g}x|i d|dh|d6D]}|do-g}|dD]}||dqk~}n |dx9|D]1}| i|i||d|}|i|qWqKWx5t|D]'}|i}|dp t} qqW| |d=   $W I $ #(UtloggingR=tconcurrent.futuresRRRtcopyRRRRthashlibRRRR R tos.pathR R R RRRRR<trandomRRt threadingRtsixRRtsix.moves.queueRRRtsix.moves.urllib.parseRRRRRt swiftclientRtswiftclient.command_helpersRRR tswiftclient.utilsR!R"R#R$R%R&tswiftclient.exceptionsR'tswiftclient.multithreadingR(t getLoggerRR)RR5RfRRR=RRRRjRRR*RRRRRRRR(((s?/tmp/pip-build-cD3xZi/python-swiftclient/swiftclient/service.pyts  "4 .  " %     3