Viewing File: /usr/lib/python2.7/site-packages/euca2ools/commands/bundle/unbundlestream.pyo
ó
¡ôXc @ sÀ d d l Z d d l Z d d l m Z d d l m Z d d l m Z m Z d d l
Z
d d l m Z m
Z
d d l m Z d d l m Z d d l m Z d e e e f d
„ ƒ YZ d S( iÿÿÿÿN( t Arg( t BaseCommand( t FileTransferProgressBarMixint RegionConfigurableMixin( t create_unbundle_pipelinet copy_with_progressbar( t open_pipe_fileobjs( t Euca2ools( t filesizet UnbundleStreamc B sÈ e Z d Z e Z e d d d d d d d ƒe d d d d d d d ƒe d
d d d e d d
ƒe d d d d e d d ƒe d d d d e d d ƒe d d d d d ƒg Z d „ 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 -it destt sourcet metavart FILEt helps- file to read the bundle from (default: stdin)s -os6 file to write the unbundled image to (default: stdout)s --enc-keyt HEXt requiredsG the
symmetric key used to encrypt the bundle (required)s --enc-ivsO the initialization vector used to encrypt the bundle
(required)s --image-sizet BYTESt types, verify the unbundled image is a certain sizes
--sha1-digestsX verify the image's
contents against a SHA1 digest from its manifest filec C s! t j | ƒ | j ƒ | j j d ƒ s= | j d d k rh t j t j t j j
ƒ ƒ ƒ | j d <n6 t | j d t j
ƒ rž t | j d ƒ | j d <n | j j d ƒ sÄ | j d d k rä t j | j d <t | j d <n9 t | j d t j
ƒ rt | j d d ƒ | j d <n d S( NR t -R
t
show_progresst w( R t configuret update_config_viewt argst gett ost fdopent dupt syst stdint filenot
isinstancet sixt string_typest opent stdoutt False( t self( ( sL /usr/lib/python2.7/site-packages/euca2ools/commands/bundle/unbundlestream.pyR ? s
&+&c C sz | j d | j j d ƒ ƒ } t ƒ \ } } t | j d | | j d | j d d | j ƒ} | j ƒ t | | j d d | ƒ} t | j ƒ d ƒ } | j ƒ t | j j d
ƒ p½ d d ƒ } | j j d ƒ } | r| | k r| j
j d | | ƒ t d
j
| | ƒ ƒ ‚ n | j j d ƒ } | rp| | k rp| j
j d | | ƒ t d j
| | ƒ ƒ ‚ n | | f S( Nt maxvalt
image_sizeR t enc_keyt enc_ivt debugR
t progressbari t sha1_digestt 0sG rejecting unbundle due to SHA1 mismatch (expected SHA1: %x, actual: %x)sB bundle appears to be corrupt (expected SHA1: {0:x}, actual: {1:x})sB rejecting unbundle due to size mismatch (expected: %i, actual: %i)s>