Current 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"