ó ¡ôXc@sâddlZddlZddlZddlmZddlmZddlmZddl m Z m Z ddl m Z ddlZddlmZddlmZmZmZdd lmZd ee e fd „ƒYZdS( iÿÿÿÿN(tArg(t BaseCommand(t ArgumentError(tFileTransferProgressBarMixintRegionConfigurableMixin(t Euca2ools(tBundleManifest(t close_all_fdstopen_pipe_fileobjstwaitpid_in_thread(tUnbundleStreamtUnbundlec Bs¶eZdZeZedddedddeddƒed d dd d d ddƒedddd d d ddƒeddddddƒgZd„Z d„Z d„Z d„Z RS(sRecreate an image from its bundled parts The key used to unbundle the image must match a certificate that was used to bundle it.s-ms --manifestttypetmetavartFILEtrequiredthelps%the bundle's manifest file (required)s-ss--sourcetDIRtdefaultt.sYdirectory containing the bundled image parts (default: current directory)s-ds --destinationsOwhere to place the unbundled image (default: current directory)s-ks --privatekeys˜file containing the private key to decrypt the bundle with. This must match a certificate used when bundling the image.cCsdtj|ƒ|jƒ|jjdƒsª|jjdƒ}|jjdƒr]||jdtprivkey_filenameRRs./isdbundle part '{0}' does not exist; you may need to use -s to specify where to find the bundle's partsttargetRRtwtdesttenc_keytenc_ivt image_sizet sha1_digestt show_progress(Rtread_from_fileobjRR.RR"tjoinR/t startswithR%R=R&RtmultiprocessingtProcesst_Unbundle__read_bundle_partststarttcloseR tpidt image_nameR2R t from_otherRKRLRMt image_digestRtFalsetmain( R+R>R@t part_pathtpart_reader_out_rtpart_reader_out_wt part_readertimage_filenametimagetunbundlestream((sF/usr/lib/python2.7/site-packages/euca2ools/commands/bundle/unbundle.pyR]s:         cCs dG|GHdS(NtWrote((R+Rb((sF/usr/lib/python2.7/site-packages/euca2ools/commands/bundle/unbundle.pyt print_result¦s( t__name__t __module__t DESCRIPTIONRtSUITERR2R3tARGSRRUR]Rf(((sF/usr/lib/python2.7/site-packages/euca2ools/commands/bundle/unbundle.pyR ,s   )  %(R0RSRtrequestbuilderRtrequestbuilder.commandRtrequestbuilder.exceptionsRtrequestbuilder.mixinsRRteuca2ools.commandsRteuca2ools.bundle.pipesR5teuca2ools.bundle.manifestRteuca2ools.bundle.utilRRR t(euca2ools.commands.bundle.unbundlestreamR R (((sF/usr/lib/python2.7/site-packages/euca2ools/commands/bundle/unbundle.pyts