Viewing File: /usr/lib/python2.7/site-packages/euca2ools/commands/bundle/uploadbundle.pyo

ķ
ĄôXc@s­ddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZde
eefd	„ƒYZd
„ZdS(i˙˙˙˙N(tArg(tFileTransferProgressBarMixin(tBundleManifest(tBundleUploadingMixin(t	S3Request(t	PutObjecttUploadBundlecBsžeZdZedddddeddƒedd	dd
ddƒeddd
dedddejƒedddddƒgZd„Z	d„Z
d„ZRS(s:Upload a bundle prepared by euca-bundle-image to the clouds-ms
--manifesttmetavartFILEtrequiredthelps,manifest for the bundle to upload (required)s-ds--directorytDIRshdirectory that contains the bundle parts (default:
                directory that contains the manifest)s--parttINTttypetdefaultis--skipmanifesttactiont
store_truesdo not upload the manifestcCs|jƒtj|ƒdS(N(tconfigure_bundle_upload_authRt	configure(tself((sJ/usr/lib/python2.7/site-packages/euca2ools/commands/bundle/uploadbundle.pyR5s
c	
s|jƒ‰|jƒtj|jdƒ}|jjdƒpTtjj|jdƒ}x\|j	D]Q}tjj
||jƒ|_tjj|jƒsat
dj|jƒƒ‚qaqaWtjdtƒ\}}tjdtd||fƒ}|jƒ|jƒ|j|ˆd|jjdƒƒ|j
ƒ|jjdƒsēˆtjj|jdƒ}tj|d	|jdd
|d|jjdƒpdd
|jjd
ƒp§dƒ}|jƒnd}it‡fd†|j	Dƒƒd6i|jdd6|d6fd6S(Ntmanifestt	directorysno such part: '{0}'tduplexttargettargst
show_progresstskipmanifesttsourcetdesttacls
aws-exec-readtretriesic3s9|]/}i|jd6ˆtjj|jƒd6VqdS(tfilenametkeyN(Rtostpathtbasename(t.0tpart(t
key_prefix(sJ/usr/lib/python2.7/site-packages/euca2ools/commands/bundle/uploadbundle.pys	<genexpr>`stpartsRR t	manifests(tget_bundle_key_prefixtensure_dest_bucket_existsRtread_from_fileRtgetR!R"tdirnametimage_partstjoinRtisfilet
ValueErrortformattmultiprocessingtPipetFalsetProcesst_generate_bundle_partststarttclosetupload_bundle_partsR#Rt
from_othertmaintNonettuple(	RRtpart_dirR%t
part_out_rt
part_out_wtpart_gent
manifest_desttreq((R&sJ/usr/lib/python2.7/site-packages/euca2ools/commands/bundle/uploadbundle.pyR<<s<




cCsb|jr.x"|dD]}dG|dGHqWn|ddddk	r^dG|dddGHndS(NR'tUploadedR R(i(tdebugR=(RtresultR%((sJ/usr/lib/python2.7/site-packages/euca2ools/commands/bundle/uploadbundle.pytprint_resultgs
	(t__name__t
__module__tDESCRIPTIONRtTruetinttargparsetSUPPRESStARGSRR<RH(((sJ/usr/lib/python2.7/site-packages/euca2ools/commands/bundle/uploadbundle.pyR's			+cCs7z%x|jD]}|j|ƒq
WWd|jƒXdS(N(R.tsendR9(Rt
out_mpconnR%((sJ/usr/lib/python2.7/site-packages/euca2ools/commands/bundle/uploadbundle.pyR7os(RNR3tos.pathR!trequestbuilderRtrequestbuilder.mixinsRteuca2ools.bundle.manifestRt euca2ools.commands.bundle.mixinsRteuca2ools.commands.s3Rteuca2ools.commands.s3.putobjectRRR7(((sJ/usr/lib/python2.7/site-packages/euca2ools/commands/bundle/uploadbundle.pyt<module>s	G
Back to Directory File Manager