Current File : //lib/python2.7/site-packages/euca2ools/commands/bundle/downloadbundle.pyc |
�
��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 d d l 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 BundleDownloadingMixin( t S3Requestt DownloadBundlec B sS e Z d Z e d d d d d d d d d d �g Z d
� Z d � Z d � Z RS(
s� Download a bundled image from the cloud
You must run euca-unbundle-image on the bundle you download to obtain the original image.s -ds --directoryt destt metavart DIRt defaultt .t helpsj the directory to download the bundle parts to, or "-"
to write the bundled image to stdoutc C s� t j | � | j d d k r@ t j | j d <t | j d <n� t | j d t j � r� t j
j | j d � s� t d j
| j d � � � n t j
j | j d � s� t d j
| j d � � � q� n d S( NR t -t
show_progresss- argument -d/--directory: '{0}' does not exists1 argument -d/--directory: '{0}' is not a directory( R t configuret argst syst stdoutt Falset
isinstancet sixt string_typest ost patht existsR t formatt isdir( t self( ( sL /usr/lib/python2.7/site-packages/euca2ools/commands/bundle/downloadbundle.pyR 1 s
c C sv | j | j � } t | j d t j � rM | j | | j d | j � } n | j | | j d | j � } | | f S( NR ( t fetch_manifestt serviceR R R R t download_bundle_to_dirt download_bundle_to_fileobj( R t manifestt
manifest_dest( ( sL /usr/lib/python2.7/site-packages/euca2ools/commands/bundle/downloadbundle.pyt mainB s c C s] | \ } } | rY t | j d t j � sM | j d j � t j j � k rY d G| GHn d S( NR s Wrote manifest( R R R R t filenoR R ( R t resultt _t manifest_filename( ( sL /usr/lib/python2.7/site-packages/euca2ools/commands/bundle/downloadbundle.pyt print_resultL s
"( t __name__t
__module__t DESCRIPTIONR t ARGSR R"