Current File : //usr/lib/python2.7/site-packages/euca2ools/commands/bundle/downloadandunbundle.pyc |
�
��Xc @ s� d d l Z d d l Z d d l Z d d l m Z d d l m Z d d l m Z d d l
Z
d d l m Z d d l m
Z
d d l 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
ArgumentError( t FileTransferProgressBarMixin( t open_pipe_fileobjs( t waitpid_in_thread( t DownloadBundle( t BundleDownloadingMixin( t UnbundleStream( t S3Requestt DownloadAndUnbundlec B sw e Z d Z e d d d d d d d d d d �e d
d d d �g Z d
� Z d � Z d � Z d � Z d � Z RS( s� Download and unbundle a bundled image from the cloud
The key used to unbundle the image must match a certificate that was used to bundle it.s -ds
--destinationt destt metavars (FILE | DIR)t defaultt .t helpsO where 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.c C sZ t j | � | j j d � s� | j j d � } | j j d � rS | | j d <q� d t j k r{ t j d � | j d <q� | r� | | j d <q� t d � � n t j
j t j
j | j d � � | j d <t j
j
| j d � st d j | j d � � � n t j
j | j d � s<t d j | j d � � � n | j j d | j d � d S( Nt
privatekeys private-keyt
userregiont EC2_PRIVATE_KEYs. missing private key; please supply one with -ks% private key file '{0}' does not exists$ private key file '{0}' is not a files private key: %s( R t configuret argst gett configt get_user_optiont ost environt getenvR t patht
expandusert
expandvarst existst formatt isfilet logt debug( t selft config_privatekey( ( sQ /usr/lib/python2.7/site-packages/euca2ools/commands/bundle/downloadandunbundle.pyR 9 s(
c C s� | j d d k r3 t j | j d <t | j d <n{ t | j d t j � r� t j j | j d � r� t j j
| j d | j � } n
| j d } t | d � | j d <| Sd S( NR
t -t
show_progresst w(
R t syst stdoutt Falset
isinstancet sixt string_typesR R t isdirt joint
image_namet open( R"