Viewing File: /usr/lib/python2.7/site-packages/euca2ools/bundle/pipes/core.pyo
ó
¡ôXc @ s¤ d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z e d „ Z e d „ Z
d d „ Z e d „ Z
e d „ Z e d „ Z d S( iÿÿÿÿN( t
close_all_fdsc
C s) g } t j j j ƒ \ } } t j d t d | | | f d i | d 6ƒ } | j ƒ | j | j ƒ | j
ƒ | j
ƒ t j j j ƒ \ }
} t j d t ƒ \ } }
t j d t
d i | d 6d | | |
f ƒ } | j ƒ | j | j ƒ | j
ƒ | j
ƒ |
j
ƒ y4 t j d d g d |
d t j d
t d d ƒ} WnA t k
r‡t j d
d g d |
d t j d
t d d ƒ} n X|
j
ƒ | j | j ƒ t j d d d d d | d | g d | j d | d
t d d ƒ} | j j
ƒ | j | j ƒ x! | D] } t j j j | ƒ qW| S( Nt targett argst kwargst debugt duplext pigzs -ct stdint stdoutt close_fdst bufsizeiÿÿÿÿt gzipt opensslt encs -es -aes-128-cbcs -Ks -iv( t euca2oolst bundlet utilt open_pipe_fileobjst multiprocessingt Processt _create_tarball_from_streamt startt appendt pidt closet Pipet Falset _calc_sha1_for_pipet
subprocesst Popent PIPEt Truet OSErrorR t waitpid_in_thread( t infilet outfilet enc_keyt enc_ivt tarinfoR t pidst tar_out_rt tar_out_wt tar_pt digest_out_rt digest_out_wt digest_result_rt digest_result_wt digest_pR R R ( ( s? /usr/lib/python2.7/site-packages/euca2ools/bundle/pipes/core.pyt create_bundle_pipeline$ sL
c
C s g } t j d d d d d | d | g d | d t j d t d
d ƒ} | j | j ƒ | j ƒ y: t j d d
d g d | j d t j d t d
d ƒ} WnG t k
rå t j d d
d g d | j d t j d t d
d ƒ} n X| j | j ƒ | j j ƒ t j
j j ƒ \ } } t
j d t ƒ \ }
} t
j d t d i | d 6d | j | | f ƒ } | j ƒ | j | j ƒ | j j ƒ | j ƒ | j ƒ t
j d t d | | f d i | d 6ƒ }
|
j ƒ | j ƒ | j |
j ƒ x! | D] } t j
j j | ƒ qõW|
S( s˜
Create a pipeline to perform the unbundle operation on infile input.
The resulting unbundled image will be written to 'outfile'.
:param outfile: file obj to write unbundled image to
:param enc_key: the encryption key used to bundle the image
:param enc_iv: the encyrption initialization vector used in the bundle
:returns multiprocess pipe to read sha1 digest of written image
R R
s -ds -aes-128-cbcs -Ks -ivR R R R
iÿÿÿÿR s -cR R R R R R ( R R R R R R R R R R R R R R R R R R R t _extract_from_tarball_streamR! ( R"