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

ó
¡ôXc@sÀddlZddlZddlmZddlmZddlmZm	Z	ddl
Z
ddlmZm
Z
ddlmZddlmZddlmZd	eee	fd
„ƒYZdS(iÿÿÿÿN(tArg(tBaseCommand(tFileTransferProgressBarMixintRegionConfigurableMixin(tcreate_unbundle_pipelinetcopy_with_progressbar(topen_pipe_fileobjs(t	Euca2ools(tfilesizetUnbundleStreamcBsÈeZdZeZedddddddƒeddddddd	ƒed
dddedd
ƒeddddeddƒeddddeddƒedddddƒgZd„Z	d„Z
RS(s‡Recreate an image solely from its combined bundled parts without using a manifest

Usually one would want to use euca-unbundle instead.s-itdesttsourcetmetavartFILEthelps-file to read the bundle from (default: stdin)s-os6file to write the unbundled image to (default: stdout)s	--enc-keytHEXtrequiredsGthe
                symmetric key used to encrypt the bundle (required)s--enc-ivsOthe initialization vector used to encrypt the bundle
                (required)s--image-sizetBYTESttypes,verify the unbundled image is a certain sizes
--sha1-digestsXverify the image's
                contents against a SHA1 digest from its manifest filecCs!tj|ƒ|jƒ|jjdƒs=|jddkrhtjtjtj	j
ƒƒƒ|jd<n6t|jdtj
ƒržt|jdƒ|jd<n|jjdƒsÄ|jddkrätj|jd<t|jd<n9t|jdtj
ƒrt|jddƒ|jd<ndS(NRt-R
t
show_progresstw(Rt	configuretupdate_config_viewtargstgettostfdopentduptsyststdintfilenot
isinstancetsixtstring_typestopentstdouttFalse(tself((sL/usr/lib/python2.7/site-packages/euca2ools/commands/bundle/unbundlestream.pyR?s

&+&c	Csz|jd|jjdƒƒ}tƒ\}}t|jd||jd|jdd|jƒ}|jƒt||jdd|ƒ}t|j	ƒd	ƒ}|jƒt|jjd
ƒp½dd	ƒ}|jjdƒ}|r||kr|j
jd||ƒtd
j
||ƒƒ‚n|jjdƒ}|rp||krp|j
jd||ƒtdj
||ƒƒ‚n||fS(Ntmaxvalt
image_sizeRtenc_keytenc_ivtdebugR
tprogressbaritsha1_digestt0sGrejecting unbundle due to SHA1 mismatch (expected SHA1: %x, actual: %x)sBbundle appears to be corrupt (expected SHA1: {0:x}, actual: {1:x})sBrejecting unbundle due to size mismatch (expected: %i, actual: %i)s>bundle appears to be corrupt (expected size: {0}, actual: {1})(tget_progressbarRRRRR+tcloseRtinttrecvtlogterrortRuntimeErrortformat(	R&tpbartunbundle_out_rtunbundle_out_wtunbundle_sha1_rtactual_sizetactual_sha1t
expected_sha1t
expected_size((sL/usr/lib/python2.7/site-packages/euca2ools/commands/bundle/unbundlestream.pytmainQs0
	
!
	
	(t__name__t
__module__tDESCRIPTIONRtSUITERtTrueRtARGSRR?(((sL/usr/lib/python2.7/site-packages/euca2ools/commands/bundle/unbundlestream.pyR	*s 	(tos.pathRRtrequestbuilderRtrequestbuilder.commandRtrequestbuilder.mixinsRRR!teuca2ools.bundle.pipes.coreRRteuca2ools.bundle.utilRteuca2ools.commandsRteuca2ools.commands.argtypesRR	(((sL/usr/lib/python2.7/site-packages/euca2ools/commands/bundle/unbundlestream.pyt<module>s	
Back to Directory File Manager