ó ¡ôXc@sÀddlZddlZddlmZddlmZddlmZm Z ddl Z ddl m Z m Z ddlmZddlmZddlmZd eee fd „ƒYZdS( iÿÿÿÿN(tArg(t BaseCommand(tFileTransferProgressBarMixintRegionConfigurableMixin(tcreate_unbundle_pipelinetcopy_with_progressbar(topen_pipe_fileobjs(t Euca2ools(tfilesizetUnbundleStreamc BsÈeZdZeZedddddddƒeddddddd ƒed dd d edd ƒeddd d eddƒeddddeddƒeddd ddƒ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 ƒƒƒ|jdbundle appears to be corrupt (expected size: {0}, actual: {1})(tget_progressbarRRRRR+tcloseRtinttrecvtlogterrort RuntimeErrortformat( R&tpbartunbundle_out_rtunbundle_out_wtunbundle_sha1_rt actual_sizet actual_sha1t expected_sha1t expected_size((sL/usr/lib/python2.7/site-packages/euca2ools/commands/bundle/unbundlestream.pytmainQs0   !      ( t__name__t __module__t DESCRIPTIONRtSUITERtTrueRtARGSRR?(((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.pyts